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

Commit 1e80c634 authored by ryanlwlin's avatar ryanlwlin
Browse files

Revise string and change asset

Change icon to a11y asset and change string based on
String doc

Bug: 174336318
Test: 1. adb shell settings put secure \
      accessibility_show_window_magnification_prompt 1
      2. use full-screen magnification to see if it works well
      atest WindowMagnificationPromptControllerTest
Change-Id: I110ca30b95e268bcad5e9109d7715e854118f0db
parent f1ce6c68
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -5893,9 +5893,9 @@ ul.</string>
    <!-- Window magnification prompt related string. -->

    <!-- Notification title to prompt the user that new magnification feature is available. [CHAR LIMIT=50] -->
    <string name="window_magnification_prompt_title">Magnify part of your screen</string>
    <string name="window_magnification_prompt_title">New magnification settings</string>
    <!-- Notification content to prompt the user that new magnification feature is available. [CHAR LIMIT=NONE] -->
    <string name="window_magnification_prompt_content">You can now magnify your full screen, a specific area, or switch between both options.</string>
    <string name="window_magnification_prompt_content">You can now magnify part of your screen.</string>
    <!-- Notification action to bring the user to magnification settings page. [CHAR LIMIT=50] -->
    <string name="turn_on_magnification_settings_action">Turn on in Settings</string>
    <!-- Notification action to dismiss. [CHAR LIMIT=50] -->
+2 −7
Original line number Diff line number Diff line
@@ -108,7 +108,7 @@ public class WindowMagnificationPromptController {
                SystemNotificationChannels.ACCESSIBILITY_MAGNIFICATION);
        final String message = mContext.getString(R.string.window_magnification_prompt_content);

        notificationBuilder.setSmallIcon(R.drawable.ic_settings_24dp)
        notificationBuilder.setSmallIcon(R.drawable.ic_accessibility_24dp)
                .setContentTitle(mContext.getString(R.string.window_magnification_prompt_title))
                .setContentText(message)
                .setLargeIcon(Icon.createWithResource(mContext,
@@ -118,7 +118,7 @@ public class WindowMagnificationPromptController {
                .setStyle(new Notification.BigTextStyle().bigText(message))
                .setDeleteIntent(createPendingIntent(ACTION_DISMISS))
                .setContentIntent(createPendingIntent(ACTION_TURN_ON_IN_SETTINGS))
                .setActions(buildTurnOnAction(), buildDismissAction());
                .setActions(buildTurnOnAction());
        mNotificationManager.notify(NOTE_A11Y_WINDOW_MAGNIFICATION_FEATURE,
                notificationBuilder.build());
        registerReceiverIfNeeded();
@@ -145,11 +145,6 @@ public class WindowMagnificationPromptController {
                createPendingIntent(ACTION_TURN_ON_IN_SETTINGS)).build();
    }

    private Notification.Action buildDismissAction() {
        return new Notification.Action.Builder(null, mContext.getString(R.string.dismiss_action),
                createPendingIntent(ACTION_DISMISS)).build();
    }

    private PendingIntent createPendingIntent(String action) {
        final Intent intent = new Intent(action);
        intent.setPackage(mContext.getPackageName());