From 1e80c6346e699cd42db2ba853744c281e6462be6 Mon Sep 17 00:00:00 2001 From: ryanlwlin Date: Wed, 24 Mar 2021 19:38:39 +0800 Subject: [PATCH] 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 --- core/res/res/values/strings.xml | 4 ++-- .../WindowMagnificationPromptController.java | 9 ++------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml index 7ea762c2fbbb3..0a97a60fb4193 100644 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml @@ -5893,9 +5893,9 @@ ul. - Magnify part of your screen + New magnification settings - You can now magnify your full screen, a specific area, or switch between both options. + You can now magnify part of your screen. Turn on in Settings diff --git a/services/accessibility/java/com/android/server/accessibility/magnification/WindowMagnificationPromptController.java b/services/accessibility/java/com/android/server/accessibility/magnification/WindowMagnificationPromptController.java index d2c1bc10abb0d..1fdd9083b7cc1 100644 --- a/services/accessibility/java/com/android/server/accessibility/magnification/WindowMagnificationPromptController.java +++ b/services/accessibility/java/com/android/server/accessibility/magnification/WindowMagnificationPromptController.java @@ -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());