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

Commit 04f7e474 authored by Alexandra Gherghina's avatar Alexandra Gherghina Committed by Android (Google) Code Review
Browse files

Merge "Revert "Revert "Wiring for displaying managed profiles"""

parents 812b1997 423bafcc
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -4779,6 +4779,10 @@
    <string name="user_add_user_menu">Add user or profile</string>
    <!-- User settings summary for a restricted profile [CHAR LIMIT=50] -->
    <string name="user_summary_restricted_profile">Restricted profile</string>
    <!-- User settings summary for a managed profile [CHAR LIMIT=50] -->
    <string name="user_summary_managed_profile">Managed profile</string>
    <!-- User settings summary for an inactive managed profile [CHAR LIMIT=50] -->
    <string name="user_summary_managed_profile_not_enabled">Managed profile (currently inactive)</string>
    <!-- User settings warning that restricted profile needs a screen lock [CHAR LIMIT=NONE] -->
    <string name="user_need_lock_message">Before you can create a restricted profile, you\'ll need to set up a screen lock to protect your apps and personal data.</string>
    <!-- User settings dialog button to set screen lock [CHAR LIMIT=25] -->
@@ -4787,6 +4791,8 @@
    <string name="user_summary_not_set_up">Not set up</string>
    <!-- User summary to indicate that restricted profile is currently not set up [CHAR LIMIT=100] -->
    <string name="user_summary_restricted_not_set_up">Not set up - Restricted profile</string>
    <!-- User summary to indicate that a managed profile is currently not set up [CHAR LIMIT=100] -->
    <string name="user_summary_managed_profile_not_set_up">Not set up - Managed profile</string>
    <!-- User information string to represent the owner of the device [CHAR LIMIT=25] -->
    <string name="user_owner">Owner</string>
    <!-- User settings title for current user entry "You" user. [CHAR LIMIT=30] -->
+15 −3
Original line number Diff line number Diff line
@@ -639,11 +639,23 @@ public class UserSettings extends RestrictedSettingsFragment
                pref.setTitle(user.name);
            }
            if (!isInitialized(user)) {
                pref.setSummary(user.isRestricted()
                        ? R.string.user_summary_restricted_not_set_up
                        : R.string.user_summary_not_set_up);
                if (user.isRestricted()) {
                    pref.setSummary(R.string.user_summary_restricted_not_set_up);
                } else if (user.isManagedProfile()) {
                    pref.setSummary(R.string.user_summary_managed_profile_not_set_up);
                } else {
                    pref.setSummary(R.string.user_summary_not_set_up);
                }
            } else if (user.isRestricted()) {
                pref.setSummary(R.string.user_summary_restricted_profile);
            } else if (user.isManagedProfile()) {
                DevicePolicyManager dpm = (DevicePolicyManager)
                        getActivity().getSystemService(Context.DEVICE_POLICY_SERVICE);
                if (dpm.isProfileEnabled(user.id)) {
                    pref.setSummary(R.string.user_summary_managed_profile);
                } else {
                    pref.setSummary(R.string.user_summary_managed_profile_not_enabled);
                }
            }
            if (user.iconPath != null) {
                if (mUserIcons.get(user.id) == null) {