Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c1d81b4a authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Update strings related to intent resolver and share sheet." into...

Merge "Update strings related to intent resolver and share sheet." into rvc-dev am: ac8a5397 am: 994a6f34

Change-Id: I6bf00bf50f75c2ef22f1d2c40496c1579029d48a
parents e4a234bc 994a6f34
Loading
Loading
Loading
Loading
+22 −17
Original line number Diff line number Diff line
@@ -299,11 +299,8 @@ public abstract class AbstractMultiProfilePagerAdapter extends PagerAdapter {
                    .createEvent(DevicePolicyEnums.RESOLVER_EMPTY_STATE_WORK_APPS_DISABLED)
                    .setStrings(getMetricsCategory())
                    .write();
            showEmptyState(activeListAdapter,
                    R.drawable.ic_work_apps_off,
                    R.string.resolver_turn_on_work_apps,
                    R.string.resolver_turn_on_work_apps_explanation,
                    (View.OnClickListener) v -> {
            showWorkProfileOffEmptyState(activeListAdapter,
                    v -> {
                        ProfileDescriptor descriptor = getItem(
                                userHandleToPageIndex(activeListAdapter.getUserHandle()));
                        showSpinner(descriptor.getEmptyStateView());
@@ -319,19 +316,13 @@ public abstract class AbstractMultiProfilePagerAdapter extends PagerAdapter {
                                DevicePolicyEnums.RESOLVER_EMPTY_STATE_NO_SHARING_TO_PERSONAL)
                            .setStrings(getMetricsCategory())
                            .write();
                    showEmptyState(activeListAdapter,
                            R.drawable.ic_sharing_disabled,
                            R.string.resolver_cant_share_with_personal_apps,
                            R.string.resolver_cant_share_cross_profile_explanation);
                    showNoWorkToPersonalIntentsEmptyState(activeListAdapter);
                } else {
                    DevicePolicyEventLogger.createEvent(
                            DevicePolicyEnums.RESOLVER_EMPTY_STATE_NO_SHARING_TO_WORK)
                            .setStrings(getMetricsCategory())
                            .write();
                    showEmptyState(activeListAdapter,
                            R.drawable.ic_sharing_disabled,
                            R.string.resolver_cant_share_with_work_apps,
                            R.string.resolver_cant_share_cross_profile_explanation);
                    showNoPersonalToWorkIntentsEmptyState(activeListAdapter);
                }
                return false;
            }
@@ -340,6 +331,15 @@ public abstract class AbstractMultiProfilePagerAdapter extends PagerAdapter {
        return activeListAdapter.rebuildList(doPostProcessing);
    }

    protected abstract void showWorkProfileOffEmptyState(
            ResolverListAdapter activeListAdapter, View.OnClickListener listener);

    protected abstract void showNoPersonalToWorkIntentsEmptyState(
            ResolverListAdapter activeListAdapter);

    protected abstract void showNoWorkToPersonalIntentsEmptyState(
            ResolverListAdapter activeListAdapter);

    void showEmptyState(ResolverListAdapter listAdapter) {
        UserHandle listUserHandle = listAdapter.getUserHandle();
        if (UserHandle.myUserId() == listUserHandle.getIdentifier()
@@ -353,16 +353,16 @@ public abstract class AbstractMultiProfilePagerAdapter extends PagerAdapter {
            showEmptyState(listAdapter,
                    R.drawable.ic_no_apps,
                    R.string.resolver_no_apps_available,
                    R.string.resolver_no_apps_available_explanation);
                    /* subtitleRes */ 0);
        }
    }

    private void showEmptyState(ResolverListAdapter activeListAdapter,
    protected void showEmptyState(ResolverListAdapter activeListAdapter,
            @DrawableRes int iconRes, @StringRes int titleRes, @StringRes int subtitleRes) {
        showEmptyState(activeListAdapter, iconRes, titleRes, subtitleRes, /* buttonOnClick */ null);
    }

    private void showEmptyState(ResolverListAdapter activeListAdapter,
    protected void showEmptyState(ResolverListAdapter activeListAdapter,
            @DrawableRes int iconRes, @StringRes int titleRes, @StringRes int subtitleRes,
            View.OnClickListener buttonOnClick) {
        ProfileDescriptor descriptor = getItem(
@@ -379,7 +379,12 @@ public abstract class AbstractMultiProfilePagerAdapter extends PagerAdapter {
        title.setText(titleRes);

        TextView subtitle = emptyStateView.findViewById(R.id.resolver_empty_state_subtitle);
        if (subtitleRes != 0) {
            subtitle.setVisibility(View.VISIBLE);
            subtitle.setText(subtitleRes);
        } else {
            subtitle.setVisibility(View.GONE);
        }

        Button button = emptyStateView.findViewById(R.id.resolver_empty_state_button);
        button.setVisibility(buttonOnClick != null ? View.VISIBLE : View.GONE);
+27 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.annotation.Nullable;
import android.content.Context;
import android.os.UserHandle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.android.internal.R;
@@ -169,6 +170,32 @@ public class ChooserMultiProfilePagerAdapter extends AbstractMultiProfilePagerAd
        return ResolverActivity.METRICS_CATEGORY_CHOOSER;
    }

    @Override
    protected void showWorkProfileOffEmptyState(ResolverListAdapter activeListAdapter,
            View.OnClickListener listener) {
        showEmptyState(activeListAdapter,
                R.drawable.ic_work_apps_off,
                R.string.resolver_turn_on_work_apps_share,
                /* subtitleRes */ 0,
                listener);
    }

    @Override
    protected void showNoPersonalToWorkIntentsEmptyState(ResolverListAdapter activeListAdapter) {
        showEmptyState(activeListAdapter,
                R.drawable.ic_sharing_disabled,
                R.string.resolver_cant_share_with_work_apps,
                R.string.resolver_cant_share_cross_profile_explanation);
    }

    @Override
    protected void showNoWorkToPersonalIntentsEmptyState(ResolverListAdapter activeListAdapter) {
        showEmptyState(activeListAdapter,
                R.drawable.ic_sharing_disabled,
                R.string.resolver_cant_share_with_personal_apps,
                R.string.resolver_cant_share_cross_profile_explanation);
    }

    class ChooserProfileDescriptor extends ProfileDescriptor {
        private ChooserActivity.ChooserGridAdapter chooserGridAdapter;
        private RecyclerView recyclerView;
+9 −1
Original line number Diff line number Diff line
@@ -1595,9 +1595,17 @@ public class ResolverActivity extends Activity implements
    }

    private void resetTabsHeaderStyle(TabWidget tabWidget) {
        String workContentDescription = getString(R.string.resolver_work_tab_accessibility);
        String personalContentDescription = getString(R.string.resolver_personal_tab_accessibility);
        for (int i = 0; i < tabWidget.getChildCount(); i++) {
            TextView title = tabWidget.getChildAt(i).findViewById(android.R.id.title);
            View tabView = tabWidget.getChildAt(i);
            TextView title = tabView.findViewById(android.R.id.title);
            title.setTextColor(getColor(R.color.resolver_tabs_inactive_color));
            if (title.getText().equals(getString(R.string.resolver_personal_tab))) {
                tabView.setContentDescription(personalContentDescription);
            } else if (title.getText().equals(getString(R.string.resolver_work_tab))) {
                tabView.setContentDescription(workContentDescription);
            }
        }
    }

+27 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.annotation.Nullable;
import android.content.Context;
import android.os.UserHandle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;

@@ -161,6 +162,32 @@ public class ResolverMultiProfilePagerAdapter extends AbstractMultiProfilePagerA
        return ResolverActivity.METRICS_CATEGORY_RESOLVER;
    }

    @Override
    protected void showWorkProfileOffEmptyState(ResolverListAdapter activeListAdapter,
            View.OnClickListener listener) {
        showEmptyState(activeListAdapter,
                R.drawable.ic_work_apps_off,
                R.string.resolver_turn_on_work_apps_view,
                /* subtitleRes */ 0,
                listener);
    }

    @Override
    protected void showNoPersonalToWorkIntentsEmptyState(ResolverListAdapter activeListAdapter) {
        showEmptyState(activeListAdapter,
                R.drawable.ic_sharing_disabled,
                R.string.resolver_cant_access_work_apps,
                R.string.resolver_cant_access_work_apps_explanation);
    }

    @Override
    protected void showNoWorkToPersonalIntentsEmptyState(ResolverListAdapter activeListAdapter) {
        showEmptyState(activeListAdapter,
                R.drawable.ic_sharing_disabled,
                R.string.resolver_cant_access_personal_apps,
                R.string.resolver_cant_access_personal_apps_explanation);
    }

    class ResolverProfileDescriptor extends ProfileDescriptor {
        private ResolverListAdapter resolverListAdapter;
        final ListView listView;
+25 −15
Original line number Diff line number Diff line
@@ -5385,26 +5385,36 @@
        <xliff:g id="package_name" example="com.android.example">%1$s</xliff:g> has been put into the RESTRICTED bucket</string>

    <!-- ResolverActivity - profile tabs -->
    <!-- Label for the perosnal tab of the share sheet and intent resolver [CHAR LIMIT=NONE] -->
    <!-- Label of a tab on a screen. A user can tap this tap to switch to the 'Personal' view (that shows their personal content) if they have a work profile on their device. [CHAR LIMIT=NONE] -->
    <string name="resolver_personal_tab">Personal</string>
    <!-- Label for the work tab of the share sheet and intent resolver [CHAR LIMIT=NONE] -->
    <!-- Label of a tab on a screen. A user can tap this tab to switch to the 'Work' view (that shows their work content) if they have a work profile on their device. [CHAR LIMIT=NONE] -->
    <string name="resolver_work_tab">Work</string>
    <!-- Label to indicate that the user cannot share with work apps [CHAR LIMIT=NONE] -->
    <!-- Accessibility label for the personal tab button. [CHAR LIMIT=NONE] -->
    <string name="resolver_personal_tab_accessibility">Personal view</string>
    <!-- Accessibility label for the work tab button. [CHAR LIMIT=NONE] -->
    <string name="resolver_work_tab_accessibility">Work view</string>
    <!-- Title of a screen. This text lets the user know that their IT admin doesn't allow them to share personal content with work apps. [CHAR LIMIT=NONE] -->
    <string name="resolver_cant_share_with_work_apps">Can\u2019t share with work apps</string>
    <!-- Label to indicate that the user cannot share with personal apps [CHAR LIMIT=NONE] -->
    <!-- Title of a screen. This text lets the user know that their IT admin doesn't allow them to share work content with personal apps. [CHAR LIMIT=NONE] -->
    <string name="resolver_cant_share_with_personal_apps">Can\u2019t share with personal apps</string>
    <!-- Label to explain to the user that sharing between personal and work apps is not enabled by the IT admin [CHAR LIMIT=NONE] -->
    <string name="resolver_cant_share_cross_profile_explanation">Your IT admin blocked sharing between personal and work apps</string>
    <!-- Label to indicate that the user has to turn on work apps in order to access work data [CHAR LIMIT=NONE] -->
    <string name="resolver_turn_on_work_apps">Turn on work apps</string>
    <!-- Label to explain that the user has to turn on work apps in order to access work data [CHAR LIMIT=NONE] -->
    <string name="resolver_turn_on_work_apps_explanation">Turn on work apps to access work apps &amp; contacts</string>
    <!-- Label to indicate that no apps are resolved [CHAR LIMIT=NONE] -->
    <!-- Error message. This text is explaining that the user's IT admin doesn't allow sharing between personal and work apps. [CHAR LIMIT=NONE] -->
    <string name="resolver_cant_share_cross_profile_explanation">Your IT admin blocked sharing between personal and work profiles</string>
    <!-- Title of an error screen. This error message lets the user know that their IT admin blocked access to work apps, and the personal content that they're trying to view in a work app, such as Chrome, isn't allowed. [CHAR LIMIT=NONE] -->
    <string name="resolver_cant_access_work_apps">Can\u2019t access work apps</string>
    <!-- Error message. This message lets the user know that their IT admin blocked access to work apps, and the personal content that they're trying to view in a work app, such as Chrome, isn't allowed. [CHAR LIMIT=NONE] -->
    <string name="resolver_cant_access_work_apps_explanation">Your IT admin doesn\u2019t let you view personal content in work apps</string>
    <!-- Title of an error screen. This error message lets the user know that their IT admin blocked access to personal apps, and the work content that they're trying to view in a personal app, such as Chrome, isn't allowed. [CHAR LIMIT=NONE] -->
    <string name="resolver_cant_access_personal_apps">Can\u2019t access personal apps</string>
    <!-- Error message. This message lets the user know that their IT admin blocked access to personal apps, and the work content that they're trying to view in a personal app, such as Chrome, isn't allowed. [CHAR LIMIT=NONE] -->
    <string name="resolver_cant_access_personal_apps_explanation">Your IT admin doesn\u2019t let you view work content in personal apps</string>
    <!-- Error message. This text lets the user know that they need to turn on work apps in order to share content. There's also a button a user can tap to turn on the apps. [CHAR LIMIT=NONE] -->
    <string name="resolver_turn_on_work_apps_share">Turn on work profile to share content</string>
    <!-- Error message. This text lets the user know that they need to turn on work apps in order to view content. There's also a button a user can tap to turn on the apps. [CHAR LIMIT=NONE] -->
    <string name="resolver_turn_on_work_apps_view">Turn on work profile to view content</string>
    <!-- Error message. This text lets the user know that work apps aren't available on the device. [CHAR LIMIT=NONE] -->
    <string name="resolver_no_apps_available">No apps available</string>
    <!-- Label to explain that no apps are resolved [CHAR LIMIT=NONE] -->
    <string name="resolver_no_apps_available_explanation">We couldn\u2019t find any apps</string>
    <!-- Button which switches on the disabled work profile [CHAR LIMIT=NONE] -->
    <string name="resolver_switch_on_work">Switch on work</string>
    <!-- Button text. This button turns on a user's work profile so they can access their work apps and data. [CHAR LIMIT=NONE] -->
    <string name="resolver_switch_on_work">Turn on</string>

    <!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. [CHAR LIMIT=NONE] -->
    <string name="permlab_accessCallAudio">Record or play audio in telephony calls</string>
Loading