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

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

Merge "Update strings for removing work profile" into lmp-dev

parents 9c4d5dd8 4c96267a
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -5246,12 +5246,16 @@
    <string name="user_confirm_remove_title">Remove this user?</string>
    <string name="user_confirm_remove_title">Remove this user?</string>
    <!-- Profile removal confirmation title [CHAR LIMIT=25] -->
    <!-- Profile removal confirmation title [CHAR LIMIT=25] -->
    <string name="user_profile_confirm_remove_title">Remove this profile?</string>
    <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] -->
    <!-- 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>
    <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] -->
    <!-- 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>
    <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] -->
    <!-- User removal confirmation message [CHAR LIMIT=none] -->
    <string name="user_confirm_remove_message">All apps and data will be deleted.</string>
    <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] -->
    <!-- User profile removal confirmation message [CHAR LIMIT=none] -->
    <string name="user_profile_confirm_remove_message">All apps and data will be deleted.</string>
    <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] -->
    <!-- Setting label to show that a new user is being added [CHAR LIMIT=30] -->
+17 −10
Original line number Original line Diff line number Diff line
@@ -774,17 +774,24 @@ public final class Utils {
            DialogInterface.OnClickListener onConfirmListener) {
            DialogInterface.OnClickListener onConfirmListener) {
        UserManager um = (UserManager) context.getSystemService(Context.USER_SERVICE);
        UserManager um = (UserManager) context.getSystemService(Context.USER_SERVICE);
        UserInfo userInfo = um.getUserInfo(removingUserId);
        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)
        Dialog dlg = new AlertDialog.Builder(context)
                .setTitle(UserHandle.myUserId() == removingUserId
                .setTitle(titleResId)
                    ? R.string.user_confirm_remove_self_title
                .setMessage(messageResId)
                    : (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))
                .setPositiveButton(R.string.user_delete_button,
                .setPositiveButton(R.string.user_delete_button,
                        onConfirmListener)
                        onConfirmListener)
                .setNegativeButton(android.R.string.cancel, null)
                .setNegativeButton(android.R.string.cancel, null)