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

Commit eb7a0040 authored by Oli Thompson's avatar Oli Thompson
Browse files

Change strings in unlaunchable app dialog

Test: manually tested
Bug: 265287982
Change-Id: I79eb1e80e8bcfdb69a2536563464540a43ef7f28
parent f2c1506e
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -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.
+0 −11
Original line number Diff line number Diff line
@@ -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();
+3 −7
Original line number Diff line number Diff line
@@ -5364,15 +5364,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>