From 937b03e8aba93cf04c79c0b97e5bc54a641debb7 Mon Sep 17 00:00:00 2001 From: Yuri Lin Date: Tue, 12 Apr 2022 17:15:14 -0400 Subject: [PATCH] Add strings to Settings.Secure for notification permission The Settings.Secure string is used for the "review notification permissions" notification that will be shown to users upon upgrade to T, and will track state for whether the user has seen and interacted with the notification yet. The action is an internal intent to go to the app notification settings page. This intent and activity need to be non-exported to disallow other apps from causing writes to settings. Bug: 225373531 Test: manual with change to show the notification Change-Id: I3ad1a3043eb428fab93e15d8f5ae1ada884b010f --- core/java/android/provider/Settings.java | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index 111c6704a57de..d4ce21eef794e 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -2012,6 +2012,15 @@ public final class Settings { public static final String ACTION_ALL_APPS_NOTIFICATION_SETTINGS = "android.settings.ALL_APPS_NOTIFICATION_SETTINGS"; + /** + * Activity Action: Show app settings specifically for sending notifications. Same as + * ALL_APPS_NOTIFICATION_SETTINGS but meant for internal use. + * @hide + */ + @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) + public static final String ACTION_ALL_APPS_NOTIFICATION_SETTINGS_FOR_REVIEW = + "android.settings.ALL_APPS_NOTIFICATION_SETTINGS_FOR_REVIEW"; + /** * Activity Action: Show notification settings for a single app. *

@@ -7669,6 +7678,20 @@ public final class Settings { public static final String ZEN_SETTINGS_SUGGESTION_VIEWED = "zen_settings_suggestion_viewed"; + /** + * State of whether review notification permissions notification needs to + * be shown the user, and whether the user has interacted. + * + * Valid values: + * -1 = UNKNOWN + * 0 = SHOULD_SHOW + * 1 = USER_INTERACTED + * 2 = DISMISSED + * @hide + */ + public static final String REVIEW_PERMISSIONS_NOTIFICATION_STATE = + "review_permissions_notification_state"; + /** * Whether the in call notification is enabled to play sound during calls. The value is * boolean (1 or 0).