diff options
author | Alexandra Gherghina <alexgherghina@google.com> | 2014-04-23 10:56:37 +0000 |
---|---|---|
committer | Alexandra Gherghina <alexgherghina@google.com> | 2014-04-24 18:06:06 +0100 |
commit | 423bafccbcd83fa7c4d5081c5251d60ffe991998 (patch) | |
tree | 6c8e6d26c5bb9e9af42cf078df62d2bb35ba1bf4 /src/com/android/settings/users | |
parent | 1502fba4be3ad08c7fb518dbbeb66802ee487d48 (diff) | |
download | packages_apps_Settings-423bafccbcd83fa7c4d5081c5251d60ffe991998.zip packages_apps_Settings-423bafccbcd83fa7c4d5081c5251d60ffe991998.tar.gz packages_apps_Settings-423bafccbcd83fa7c4d5081c5251d60ffe991998.tar.bz2 |
Revert "Revert "Wiring for displaying managed profiles""
This reverts commit 91e3f7256935f1c805878c3a5241b9e5b9a67e44.
Will wait until related commit is in to submit this.
Bug: 13756871
Change-Id: I34642998adb71f44de1e529cc214ac4f921932ed
Diffstat (limited to 'src/com/android/settings/users')
-rw-r--r-- | src/com/android/settings/users/UserSettings.java | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/com/android/settings/users/UserSettings.java b/src/com/android/settings/users/UserSettings.java index d8213ff..0a66046 100644 --- a/src/com/android/settings/users/UserSettings.java +++ b/src/com/android/settings/users/UserSettings.java @@ -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) { |