diff --git a/res/values/strings.xml b/res/values/strings.xml index 810bbd49b9a..f98012da29f 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -5246,12 +5246,16 @@ Remove this user? Remove this profile? + + Remove work profile? You will lose your space and data on this tablet. You can\'t undo this action. You will lose your space and data on this phone. You can\'t undo this action. All apps and data will be deleted. + + All apps and data in this profile will be deleted. All apps and data will be deleted. diff --git a/src/com/android/settings/Utils.java b/src/com/android/settings/Utils.java index e88c0fccec8..4fb166ab551 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)