diff options
| author | 2024-10-04 12:20:56 +0000 | |
|---|---|---|
| committer | 2024-10-04 12:20:56 +0000 | |
| commit | 550054fbb4b7bd6069da3c08cf779a88fe2fbeb7 (patch) | |
| tree | eb179a5e288e02646dc9fd8ab92c23adbe7e6735 | |
| parent | ead7c212133893f6276aab5f8f30471ed5997e71 (diff) | |
| parent | a660be4ef13cd76f21f14291c42eb4360ea5b8ff (diff) | |
Merge "Settings intent action for promoted notifs" into main
| -rw-r--r-- | core/api/current.txt | 1 | ||||
| -rw-r--r-- | core/java/android/app/NotificationManager.java | 3 | ||||
| -rw-r--r-- | core/java/android/provider/Settings.java | 15 |
3 files changed, 19 insertions, 0 deletions
diff --git a/core/api/current.txt b/core/api/current.txt index 34f1b6e9246a..b740ef36debe 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -37434,6 +37434,7 @@ package android.provider { field public static final String ACTION_APPLICATION_SETTINGS = "android.settings.APPLICATION_SETTINGS"; field public static final String ACTION_APP_LOCALE_SETTINGS = "android.settings.APP_LOCALE_SETTINGS"; field public static final String ACTION_APP_NOTIFICATION_BUBBLE_SETTINGS = "android.settings.APP_NOTIFICATION_BUBBLE_SETTINGS"; + field @FlaggedApi("android.app.api_rich_ongoing") public static final String ACTION_APP_NOTIFICATION_PROMOTION_SETTINGS = "android.settings.APP_NOTIFICATION_PROMOTION_SETTINGS"; field public static final String ACTION_APP_NOTIFICATION_SETTINGS = "android.settings.APP_NOTIFICATION_SETTINGS"; field public static final String ACTION_APP_OPEN_BY_DEFAULT_SETTINGS = "android.settings.APP_OPEN_BY_DEFAULT_SETTINGS"; field public static final String ACTION_APP_SEARCH_SETTINGS = "android.settings.APP_SEARCH_SETTINGS"; diff --git a/core/java/android/app/NotificationManager.java b/core/java/android/app/NotificationManager.java index dfed1f738e44..41abd68c9924 100644 --- a/core/java/android/app/NotificationManager.java +++ b/core/java/android/app/NotificationManager.java @@ -958,6 +958,9 @@ public class NotificationManager { * Returns whether the calling app's properly formatted notifications can appear in a promoted * format, which may result in higher ranking, appearances on additional surfaces, and richer * presentation. + * + * Apps can request this permission by sending the user to the activity that matches the system + * intent action {@link android.provider.Settings#ACTION_APP_NOTIFICATION_PROMOTION_SETTINGS}. */ @FlaggedApi(android.app.Flags.FLAG_API_RICH_ONGOING) public boolean canPostPromotedNotifications() { diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index a2c41c14593b..1e6f025fdbbe 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -2350,6 +2350,21 @@ public final class Settings { "android.settings.ALL_APPS_NOTIFICATION_SETTINGS_FOR_REVIEW"; /** + * Activity Action: Show the permission screen for allowing apps to post promoted notifications. + * <p> + * Input: {@link #EXTRA_APP_PACKAGE}, the package to display. + * <p> + * In some cases, a matching Activity may not exist, so ensure you + * safeguard against this. + * <p> + * Output: Nothing. + */ + @FlaggedApi(android.app.Flags.FLAG_API_RICH_ONGOING) + @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) + public static final String ACTION_APP_NOTIFICATION_PROMOTION_SETTINGS + = "android.settings.APP_NOTIFICATION_PROMOTION_SETTINGS"; + + /** * Activity Action: Show notification settings for a single app. * <p> * Input: {@link #EXTRA_APP_PACKAGE}, the package to display. |