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
This commit is contained in:
Jacqueline Bronger
2023-04-17 16:16:16 +02:00
parent b4a8a82fa9
commit 583a1b75cc
2 changed files with 7 additions and 1 deletions

View File

@@ -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,

View File

@@ -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()