From 5abe07c37f00741949770b028f7c58c8052c3c63 Mon Sep 17 00:00:00 2001 From: Yuri Lin Date: Tue, 29 Mar 2022 18:17:53 -0400 Subject: [PATCH] Add strings & channel to be used for notification to review permissions. Also changes the SYSTEM_CHANGES notification channel to be IMPORTANCE_DEFAULT (by deprecating the existing, unused one). Bug: 225373531 Test: manual by forcing the notification to show Change-Id: I9743fe08cccbd8b6a9e7b367e32fe3e597b81ec4 Merged-In: I9743fe08cccbd8b6a9e7b367e32fe3e597b81ec4 --- .../notification/SystemNotificationChannels.java | 14 ++++++++++++-- core/res/res/values/strings.xml | 10 ++++++++++ core/res/res/values/symbols.xml | 5 +++++ proto/src/system_messages.proto | 4 ++++ 4 files changed, 31 insertions(+), 2 deletions(-) diff --git a/core/java/com/android/internal/notification/SystemNotificationChannels.java b/core/java/com/android/internal/notification/SystemNotificationChannels.java index a93c487db7d7e..681b46a01c8db 100644 --- a/core/java/com/android/internal/notification/SystemNotificationChannels.java +++ b/core/java/com/android/internal/notification/SystemNotificationChannels.java @@ -58,7 +58,12 @@ public class SystemNotificationChannels { public static String USB = "USB"; public static String FOREGROUND_SERVICE = "FOREGROUND_SERVICE"; public static String HEAVY_WEIGHT_APP = "HEAVY_WEIGHT_APP"; - public static String SYSTEM_CHANGES = "SYSTEM_CHANGES"; + /** + * @deprecated Legacy system changes channel with low importance which is no longer used, + * Use the default importance {@link #SYSTEM_CHANGES} channel instead. + */ + @Deprecated public static String SYSTEM_CHANGES_DEPRECATED = "SYSTEM_CHANGES"; + public static String SYSTEM_CHANGES = "SYSTEM_CHANGES_ALERTS"; public static String DO_NOT_DISTURB = "DO_NOT_DISTURB"; public static String ACCESSIBILITY_MAGNIFICATION = "ACCESSIBILITY_MAGNIFICATION"; public static String ACCESSIBILITY_SECURITY_POLICY = "ACCESSIBILITY_SECURITY_POLICY"; @@ -189,7 +194,11 @@ public class SystemNotificationChannels { NotificationChannel systemChanges = new NotificationChannel(SYSTEM_CHANGES, context.getString(R.string.notification_channel_system_changes), - NotificationManager.IMPORTANCE_LOW); + NotificationManager.IMPORTANCE_DEFAULT); + systemChanges.setSound(null, new AudioAttributes.Builder() + .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION) + .setUsage(AudioAttributes.USAGE_NOTIFICATION) + .build()); channelsList.add(systemChanges); NotificationChannel dndChanges = new NotificationChannel(DO_NOT_DISTURB, @@ -229,6 +238,7 @@ public class SystemNotificationChannels { public static void removeDeprecated(Context context) { final NotificationManager nm = context.getSystemService(NotificationManager.class); nm.deleteNotificationChannel(DEVICE_ADMIN_DEPRECATED); + nm.deleteNotificationChannel(SYSTEM_CHANGES_DEPRECATED); } public static void createAccountChannelForPackage(String pkg, int uid, Context context) { diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml index 3d73a02fca4ae..d5fc14eeb56e5 100644 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml @@ -5745,6 +5745,16 @@ Tap to check what\'s blocked. + + + Review notification settings + + In Android 13, apps that you install need your permission to send notifications. Tap to change this permission for existing apps. + + Remind me later + + Dismiss + System diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index 776d3dafe8c07..c4d907b7725ec 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -3891,6 +3891,11 @@ + + + + + diff --git a/proto/src/system_messages.proto b/proto/src/system_messages.proto index 177b080bfbf67..dfa34bb508058 100644 --- a/proto/src/system_messages.proto +++ b/proto/src/system_messages.proto @@ -286,6 +286,10 @@ message SystemMessage { // Package: android NOTE_MTE_OVERRIDE_ENABLED = 69; + // Inform the user of notification permissions changes. + // Package: android + NOTE_REVIEW_NOTIFICATION_PERMISSIONS = 71; + // ADD_NEW_IDS_ABOVE_THIS_LINE // Legacy IDs with arbitrary values appear below // Legacy IDs existed as stable non-conflicting constants prior to the O release