Merge "Change strings in unlaunchable app dialog" into udc-dev

This commit is contained in:
Oli Thompson
2023-04-06 10:51:28 +00:00
committed by Android (Google) Code Review
3 changed files with 3 additions and 26 deletions

View File

@@ -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.

View File

@@ -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();

View File

@@ -5369,15 +5369,11 @@
<string name="app_suspended_unsuspend_message">Unpause app</string>
<!-- Title of a dialog. This text is confirming that the user wants to turn on access to their work apps, which the user had previously paused. "Work" is an adjective. [CHAR LIMIT=30] -->
<string name="work_mode_off_title">Turn on work apps?</string>
<!-- Text in a dialog. This text is confirming that the user wants to turn on access to their work apps and notifications, which the user had previously paused. "Work" is an adjective. [CHAR LIMIT=NONE] -->
<string name="work_mode_off_message">Get access to your work apps and notifications</string>
<!-- Title for button to turn on work profile. [CHAR LIMIT=NONE] -->
<string name="work_mode_turn_on">Turn on</string>
<string name="work_mode_off_title">Unpause work apps?</string>
<!-- Title for button to unpause on work profile. [CHAR LIMIT=NONE] -->
<string name="work_mode_turn_on">Unpause</string>
<!-- Title for button to launch the personal safety app to make an emergency call -->
<string name="work_mode_emergency_call_button">Emergency</string>
<!-- Text shown in a dialog when the user tries to launch a disabled work profile app when work apps are paused-->
<string name="work_mode_dialer_off_message">Get access to your work apps and calls</string>
<!-- Title of the dialog that is shown when the user tries to launch a blocked application [CHAR LIMIT=50] -->
<string name="app_blocked_title">App is not available</string>