From eb7a0040329518760cc1b048db5dd475b234c342 Mon Sep 17 00:00:00 2001 From: Oli Thompson Date: Wed, 29 Mar 2023 15:15:51 +0000 Subject: [PATCH] Change strings in unlaunchable app dialog Test: manually tested Bug: 265287982 Change-Id: I79eb1e80e8bcfdb69a2536563464540a43ef7f28 --- .../java/android/app/admin/DevicePolicyResources.java | 8 -------- .../android/internal/app/UnlaunchableAppActivity.java | 11 ----------- core/res/res/values/strings.xml | 10 +++------- 3 files changed, 3 insertions(+), 26 deletions(-) diff --git a/core/java/android/app/admin/DevicePolicyResources.java b/core/java/android/app/admin/DevicePolicyResources.java index a49891356ccd2..bb93c6167a196 100644 --- a/core/java/android/app/admin/DevicePolicyResources.java +++ b/core/java/android/app/admin/DevicePolicyResources.java @@ -1801,14 +1801,6 @@ public final class DevicePolicyResources { public static final String UNLAUNCHABLE_APP_WORK_PAUSED_TITLE = PREFIX + "UNLAUNCHABLE_APP_WORK_PAUSED_TITLE"; - /** - * Text for dialog shown when user tries to open a work app when the work profile is - * turned off, confirming that the user wants to turn on access to their - * work apps. - */ - public static final String UNLAUNCHABLE_APP_WORK_PAUSED_MESSAGE = - PREFIX + "UNLAUNCHABLE_APP_WORK_PAUSED_MESSAGE"; - /** * Notification title shown when work profile is credential encrypted and requires * the user to unlock before it's usable. diff --git a/core/java/com/android/internal/app/UnlaunchableAppActivity.java b/core/java/com/android/internal/app/UnlaunchableAppActivity.java index e47c335f9c7ed..73914a2a99f61 100644 --- a/core/java/com/android/internal/app/UnlaunchableAppActivity.java +++ b/core/java/com/android/internal/app/UnlaunchableAppActivity.java @@ -16,7 +16,6 @@ package com.android.internal.app; -import static android.app.admin.DevicePolicyResources.Strings.Core.UNLAUNCHABLE_APP_WORK_PAUSED_MESSAGE; import static android.app.admin.DevicePolicyResources.Strings.Core.UNLAUNCHABLE_APP_WORK_PAUSED_TITLE; import static android.content.Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS; import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK; @@ -87,17 +86,13 @@ public class UnlaunchableAppActivity extends Activity mTelecomManager.getDefaultDialerPackage(UserHandle.of(mUserId)))); final AlertDialog.Builder builder; - final String dialogMessage; if (showEmergencyCallButton) { builder = new AlertDialog.Builder(this, R.style.AlertDialogWithEmergencyButton); - dialogMessage = getDialogMessage(R.string.work_mode_dialer_off_message); builder.setNeutralButton(R.string.work_mode_emergency_call_button, this); } else { builder = new AlertDialog.Builder(this); - dialogMessage = getDialogMessage(R.string.work_mode_off_message); } builder.setTitle(getDialogTitle()) - .setMessage(dialogMessage) .setOnDismissListener(this) .setPositiveButton(R.string.work_mode_turn_on, this) .setNegativeButton(R.string.cancel, null); @@ -120,12 +115,6 @@ public class UnlaunchableAppActivity extends Activity UNLAUNCHABLE_APP_WORK_PAUSED_TITLE, () -> getString(R.string.work_mode_off_title)); } - private String getDialogMessage(int dialogMessageString) { - return getSystemService(DevicePolicyManager.class).getResources().getString( - UNLAUNCHABLE_APP_WORK_PAUSED_MESSAGE, - () -> getString(dialogMessageString)); - } - @Override public void onDismiss(DialogInterface dialog) { finish(); diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml index 6afdae5086232..d538157156411 100644 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml @@ -5364,15 +5364,11 @@ Unpause app - Turn on work apps? - - Get access to your work apps and notifications - - Turn on + Unpause work apps? + + Unpause Emergency - - Get access to your work apps and calls App is not available