From b2c69fb78ed2c747b6105b03cc143db9f1e53f53 Mon Sep 17 00:00:00 2001 From: Alexander Roederer Date: Sun, 24 Apr 2022 02:31:45 +0000 Subject: Updates documentation on Action Button Icons Updates documentation on Action Button icons to note that icons are not displayed as of Android 7.0. Bug: 184243364 Test: Only documentation change Change-Id: If301c9d5ca46b847be16a741d0aa3bb96b37499c --- core/java/android/app/Notification.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java index 53e7559b910b..974d20a7eab3 100644 --- a/core/java/android/app/Notification.java +++ b/core/java/android/app/Notification.java @@ -1901,6 +1901,11 @@ public class Notification implements Parcelable /** * Construct a new builder for {@link Action} object. + *

As of Android {@link android.os.Build.VERSION_CODES#N}, + * action button icons will not be displayed on action buttons, but are still required + * and are available to + * {@link android.service.notification.NotificationListenerService notification listeners}, + * which may display them in other contexts, for example on a wearable device. * @param icon icon to show for this action * @param title the title of the action * @param intent the {@link PendingIntent} to fire when users trigger this action @@ -1923,6 +1928,12 @@ public class Notification implements Parcelable * both are displayed or required, depends on where and how the action is used, and the * {@link Style} applied to the Notification. * + *

As of Android {@link android.os.Build.VERSION_CODES#N}, action button icons + * will not be displayed on action buttons, but are still required and are available + * to {@link android.service.notification.NotificationListenerService notification + * listeners}, which may display them in other contexts, for example on a wearable + * device. + * *

When the {@code title} is a {@link android.text.Spanned}, any colors set by a * {@link ForegroundColorSpan} or {@link TextAppearanceSpan} may be removed or displayed * with an altered in luminance to ensure proper contrast within the Notification. @@ -4918,6 +4929,12 @@ public class Notification implements Parcelable * while processing broadcast receivers or services in response to notification action * clicks. To launch an activity in those cases, provide a {@link PendingIntent} to the * activity itself. + *

+ * As of Android {@link android.os.Build.VERSION_CODES#N}, + * action button icons will not be displayed on action buttons, but are still required + * and are available to + * {@link android.service.notification.NotificationListenerService notification listeners}, + * which may display them in other contexts, for example on a wearable device. * * @param icon Resource ID of a drawable that represents the action. * @param title Text describing the action. -- cgit v1.2.3-59-g8ed1b