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

Commit 1449cd23 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "[enterprise-esim] Change confirmation message when deleting work profile" into main

parents 82b35d6f 97099f87
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -147,6 +147,7 @@ android_library {
        "android.provider.flags-aconfig",
        "android.security.flags-aconfig",
        "android.view.contentprotection.flags-aconfig",
        "device_policy_aconfig_flags",
        "keyboard_flags",
    ],
}
+2 −0
Original line number Diff line number Diff line
@@ -7720,6 +7720,8 @@ Data usage charges may apply.</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 if you continue.</string>
    <!-- Work profile removal confirmation message mentioning eSIM [CHAR LIMIT=none] -->
    <string name="work_profile_confirm_remove_message_with_esim">All apps and data in this profile, including work eSIMs, will be deleted if you continue.</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] -->
+12 −2
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import static android.app.admin.DevicePolicyResources.Strings.Settings.WORK_PROF

import android.app.Dialog;
import android.app.admin.DevicePolicyManager;
import android.app.admin.flags.Flags;
import android.content.Context;
import android.content.DialogInterface;
import android.content.pm.ApplicationInfo;
@@ -69,8 +70,12 @@ public final class UserDialogs {
            if (view != null) {
                builder.setView(view);
            } else {
                final int defaultWorkProfileConfirmRemoveMessageResourceId =
                        Flags.removeManagedEsimOnWorkProfileDeletion()
                                ? R.string.work_profile_confirm_remove_message_with_esim
                                : R.string.work_profile_confirm_remove_message;
                builder.setMessage(dpm.getResources().getString(WORK_PROFILE_CONFIRM_REMOVE_MESSAGE,
                        () -> context.getString(R.string.work_profile_confirm_remove_message)));
                        () -> context.getString(defaultWorkProfileConfirmRemoveMessageResourceId)));
            }
        } else if (UserHandle.myUserId() == removingUserId) {
            builder.setTitle(R.string.user_confirm_remove_self_title);
@@ -113,9 +118,14 @@ public final class UserDialogs {
                        R.string.opening_paragraph_delete_profile_unknown_company)));
        TextView closingParagraph = (TextView)
                view.findViewById(R.id.delete_managed_profile_closing_paragraph);

        final int defaultWorkProfileConfirmRemoveMessageResourceId =
                Flags.removeManagedEsimOnWorkProfileDeletion()
                        ? R.string.work_profile_confirm_remove_message_with_esim
                        : R.string.work_profile_confirm_remove_message;
        closingParagraph.setText(devicePolicyManager.getResources().getString(
                WORK_PROFILE_CONFIRM_REMOVE_MESSAGE,
                () -> context.getString(R.string.work_profile_confirm_remove_message)));
                () -> context.getString(defaultWorkProfileConfirmRemoveMessageResourceId)));

        CharSequence appLabel = packageManager.getApplicationLabel(mdmApplicationInfo);
        CharSequence badgedAppLabel = packageManager.getUserBadgedLabel(appLabel,