From 583a1b75cce16cb5ffcb751473c6bc6e408f5be4 Mon Sep 17 00:00:00 2001 From: Jacqueline Bronger Date: Mon, 17 Apr 2023 16:16:16 +0200 Subject: [PATCH] Tv PiP: add constant for custom actions extra. Adds a constant to be used as a key for adding a boolean extra to the Notification.Action. Bug: 274444475 Test: manual - custom actions should have the extra set to true Change-Id: Ibc3a073ae6a27522cd884ed948001a0ef88be6dd --- .../Shell/src/com/android/wm/shell/pip/tv/TvPipAction.java | 6 ++++++ .../src/com/android/wm/shell/pip/tv/TvPipCustomAction.java | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipAction.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipAction.java index 222307fba8c29..5f6b3fe1e250c 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipAction.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipAction.java @@ -31,6 +31,12 @@ import java.util.Objects; abstract class TvPipAction { + /** + * Extras key for adding a boolean to the {@link Notification.Action} to differentiate custom + * from system actions, most importantly to identify custom close actions. + **/ + public static final String EXTRA_IS_PIP_CUSTOM_ACTION = "EXTRA_IS_PIP_CUSTOM_ACTION"; + @Retention(RetentionPolicy.SOURCE) @IntDef(prefix = {"ACTION_"}, value = { ACTION_FULLSCREEN, diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipCustomAction.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipCustomAction.java index bca27a5c6636f..977aad4a898a7 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipCustomAction.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipCustomAction.java @@ -86,7 +86,7 @@ public class TvPipCustomAction extends TvPipAction { Bundle extras = new Bundle(); extras.putCharSequence(Notification.EXTRA_PICTURE_CONTENT_DESCRIPTION, mRemoteAction.getContentDescription()); - extras.putBoolean(Notification.EXTRA_CONTAINS_CUSTOM_VIEW, true); + extras.putBoolean(TvPipAction.EXTRA_IS_PIP_CUSTOM_ACTION, true); builder.addExtras(extras); builder.setSemanticAction(isCloseAction()