From fe04f813d75613179fe23d97e69036e033eb9d88 Mon Sep 17 00:00:00 2001 From: Jacqueline Bronger Date: Wed, 3 Jan 2024 17:20:29 +0100 Subject: TV PiP: add ComponentName to notification This lets the launcher get the icon drawable for the activity or app themselves and decide on whether they want to use the monochrome version of an adaptive icon if available since there is no way of passing a drawable to the notification. No changes are made to the icons that are already in the notification so that they can continue to be used by other launchers. Bug: 315325526 Test: manual Change-Id: I156fc9707e845616d987beea9148af248b92e492 --- .../src/com/android/wm/shell/pip/tv/TvPipNotificationController.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipNotificationController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipNotificationController.java index 1c94625ddde9..54e162bba2f3 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipNotificationController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipNotificationController.java @@ -54,6 +54,7 @@ public class TvPipNotificationController implements TvPipActionsProvider.Listene // Referenced in com.android.systemui.util.NotificationChannels. public static final String NOTIFICATION_CHANNEL = "TVPIP"; private static final String NOTIFICATION_TAG = "TvPip"; + private static final String EXTRA_COMPONENT_NAME = "TvPipComponentName"; private final Context mContext; private final PackageManager mPackageManager; @@ -176,6 +177,7 @@ public class TvPipNotificationController implements TvPipActionsProvider.Listene Bundle extras = new Bundle(); extras.putParcelable(Notification.EXTRA_MEDIA_SESSION, mMediaSessionToken); + extras.putParcelable(EXTRA_COMPONENT_NAME, PipUtils.getTopPipActivity(mContext).first); mNotificationBuilder.setExtras(extras); PendingIntent closeIntent = mTvPipActionsProvider.getCloseAction().getPendingIntent(); -- cgit v1.2.3-59-g8ed1b