summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandra Gherghina <alexgherghina@google.com>2014-08-22 11:17:29 +0100
committerAlexandra Gherghina <alexgherghina@google.com>2014-08-22 11:17:31 +0100
commit4c96267acd8bb37fd537e9d1eeaaa22acb0752d5 (patch)
treef65750ab4794765e93296afeff4bda800bf5bd73
parentfe3794a9372d643afe8cd6d8e70ec4f9e1b47a48 (diff)
downloadpackages_apps_Settings-4c96267acd8bb37fd537e9d1eeaaa22acb0752d5.zip
packages_apps_Settings-4c96267acd8bb37fd537e9d1eeaaa22acb0752d5.tar.gz
packages_apps_Settings-4c96267acd8bb37fd537e9d1eeaaa22acb0752d5.tar.bz2
Update strings for removing work profile
Bug: 17139301 Change-Id: I524946ab7856b10ed68a2e90c7f488d20731b169
-rw-r--r--res/values/strings.xml4
-rw-r--r--src/com/android/settings/Utils.java27
2 files changed, 21 insertions, 10 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml
index c2799ba..ed8142b 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -5244,12 +5244,16 @@
<string name="user_confirm_remove_title">Remove this user?</string>
<!-- Profile removal confirmation title [CHAR LIMIT=25] -->
<string name="user_profile_confirm_remove_title">Remove this profile?</string>
+ <!-- Work profile removal confirmation title [CHAR LIMIT=25] -->
+ <string name="work_profile_confirm_remove_title">Remove work profile?</string>
<!-- User (self) removal confirmation message [CHAR LIMIT=none] -->
<string name="user_confirm_remove_self_message" product="tablet">You will lose your space and data on this tablet. You can\'t undo this action.</string>
<!-- User (self) removal confirmation message [CHAR LIMIT=none] -->
<string name="user_confirm_remove_self_message" product="default">You will lose your space and data on this phone. You can\'t undo this action.</string>
<!-- User removal confirmation message [CHAR LIMIT=none] -->
<string name="user_confirm_remove_message">All apps and data will be deleted.</string>
+ <!-- Work profile removal confirmation message [CHAR LIMIT=none] -->
+ <string name="work_profile_confirm_remove_message">All apps and data in this profile will be deleted.</string>
<!-- User profile removal confirmation message [CHAR LIMIT=none] -->
<string name="user_profile_confirm_remove_message">All apps and data will be deleted.</string>
<!-- Setting label to show that a new user is being added [CHAR LIMIT=30] -->
diff --git a/src/com/android/settings/Utils.java b/src/com/android/settings/Utils.java
index e88c0fc..4fb166a 100644
--- a/src/com/android/settings/Utils.java
+++ b/src/com/android/settings/Utils.java
@@ -774,17 +774,24 @@ public final class Utils {
DialogInterface.OnClickListener onConfirmListener) {
UserManager um = (UserManager) context.getSystemService(Context.USER_SERVICE);
UserInfo userInfo = um.getUserInfo(removingUserId);
+ int titleResId;
+ int messageResId;
+ if (UserHandle.myUserId() == removingUserId) {
+ titleResId = R.string.user_confirm_remove_self_title;
+ messageResId = R.string.user_confirm_remove_self_message;
+ } else if (userInfo.isRestricted()) {
+ titleResId = R.string.user_profile_confirm_remove_title;
+ messageResId = R.string.user_profile_confirm_remove_message;
+ } else if (userInfo.isManagedProfile()) {
+ titleResId = R.string.work_profile_confirm_remove_title;
+ messageResId = R.string.work_profile_confirm_remove_message;
+ } else {
+ titleResId = R.string.user_confirm_remove_title;
+ messageResId = R.string.user_confirm_remove_message;
+ }
Dialog dlg = new AlertDialog.Builder(context)
- .setTitle(UserHandle.myUserId() == removingUserId
- ? R.string.user_confirm_remove_self_title
- : (userInfo.isRestricted()
- ? R.string.user_profile_confirm_remove_title
- : R.string.user_confirm_remove_title))
- .setMessage(UserHandle.myUserId() == removingUserId
- ? R.string.user_confirm_remove_self_message
- : (userInfo.isRestricted()
- ? R.string.user_profile_confirm_remove_message
- : R.string.user_confirm_remove_message))
+ .setTitle(titleResId)
+ .setMessage(messageResId)
.setPositiveButton(R.string.user_delete_button,
onConfirmListener)
.setNegativeButton(android.R.string.cancel, null)