From 502dbc10a7bac5b585b88f920f3cb39e09ddb5a6 Mon Sep 17 00:00:00 2001 From: Alexander Roederer Date: Wed, 28 Sep 2022 20:19:55 +0000 Subject: [PATCH] Document fullScreenIntent requires IMPORTANCE_HIGH Adds documentation mentioning that full screen intent requires not just calling setFullScreenIntent, but also posting the notification to a channel with importance set to IMPORTANCE_HIGH. This is currently checked by NotificationInterruptStateProviderImpl, in shouldLaunchFullScreenIntentWhenAdded. Bug: 232793248 Test: Only documentation change Change-Id: Ia9f90464c6f1125339e5d4ebef791c449d01febc --- core/java/android/app/Notification.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java index e820733803943..f320b742a430e 100644 --- a/core/java/android/app/Notification.java +++ b/core/java/android/app/Notification.java @@ -4453,6 +4453,10 @@ public class Notification implements Parcelable *

Apps targeting {@link Build.VERSION_CODES#Q} and above will have to request * a permission ({@link android.Manifest.permission#USE_FULL_SCREEN_INTENT}) in order to * use full screen intents.

+ *

+ * To be launched as a full screen intent, the notification must also be posted to a + * channel with importance level set to IMPORTANCE_HIGH or higher. + *

* * @param intent The pending intent to launch. * @param highPriority Passing true will cause this notification to be sent