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 | |
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
-rw-r--r-- | res/values/strings.xml | 10 | ||||
-rw-r--r-- | src/com/android/settings/users/UserSettings.java | 18 |
2 files changed, 23 insertions, 5 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml index 4db22e3..18ec5f7 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -3868,7 +3868,7 @@ <!-- Text spoken by the TTS engine as an example if the engine doesn't provide sample text [CHAR LIMIT=100] --> <string name="tts_default_sample_string">This is an example of speech synthesis</string> <!-- On main TTS Settings screen, title of a field explaining current TTS engine status for - current default language [CHAR LIMIT=50] --> + current default language [CHAR LIMIT=50] --> <string name="tts_status_title">Default language status</string> <!-- On main TTS Settings screen, current TTS engine status for the current default language, selected language is fully supported by the engine [CHAR LIMIT=150]--> @@ -3880,7 +3880,7 @@ selected language is not supported by the engine [CHAR LIMIT=150] --> <string name="tts_status_not_supported"><xliff:g id="locale" example="English (United States)">%1$s</xliff:g> is not supported</string> <!-- On main TTS Settings screen, current TTS engine status for the current default language, - tts engine is queried for status [CHAR LIMIT=150] --> + tts engine is queried for status [CHAR LIMIT=150] --> <string name="tts_status_checking">Checking...</string> <!-- On main TTS Settings screen, text for divider under which all TTS engines are listed --> <string name="tts_engines_section">Engines</string> @@ -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] --> 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) { |