Loading libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/PipController.java +4 −1 Original line number Diff line number Diff line Loading @@ -224,10 +224,11 @@ public class PipController implements Pip, PipTaskOrganizer.PipTransitionCallbac PipBoundsHandler pipBoundsHandler, PipTaskOrganizer pipTaskOrganizer, PipMediaController pipMediaController, PipNotification pipNotification, WindowManagerShellWrapper windowManagerShellWrapper) { mContext = context; mPipBoundsState = pipBoundsState; mPipNotification = new PipNotification(context, this); mPipNotification = pipNotification; mPipBoundsHandler = pipBoundsHandler; mPipMediaController = pipMediaController; // Ensure that we have the display info in case we get calls to update the bounds Loading @@ -242,6 +243,8 @@ public class PipController implements Pip, PipTaskOrganizer.PipTransitionCallbac mPipTaskOrganizer.registerPipTransitionCallback(this); mActivityTaskManager = ActivityTaskManager.getService(); addListener(mPipNotification); final IntentFilter intentFilter = new IntentFilter(); intentFilter.addAction(ACTION_CLOSE); intentFilter.addAction(ACTION_MENU); Loading libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/PipNotification.java +37 −39 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import android.text.TextUtils; import com.android.internal.messages.nano.SystemMessageProto.SystemMessage; import com.android.wm.shell.R; import com.android.wm.shell.pip.PipMediaController; import java.util.Objects; Loading @@ -40,7 +41,7 @@ import java.util.Objects; * <p>Once it's created, it will manage the PIP notification UI by itself except for handling * configuration changes. */ public class PipNotification { public class PipNotification implements PipController.Listener { private static final boolean DEBUG = PipController.DEBUG; private static final String TAG = "PipNotification"; Loading @@ -63,7 +64,23 @@ public class PipNotification { private String mMediaTitle; private Bitmap mArt; private PipController.Listener mPipListener = new PipController.Listener() { public PipNotification(Context context, PipMediaController pipMediaController) { mPackageManager = context.getPackageManager(); mNotificationManager = context.getSystemService(NotificationManager.class); mNotificationBuilder = new Notification.Builder(context, NOTIFICATION_CHANNEL_TVPIP) .setLocalOnly(true) .setOngoing(false) .setCategory(Notification.CATEGORY_SYSTEM) .extend(new Notification.TvExtender() .setContentIntent(createPendingIntent(context, ACTION_MENU)) .setDeleteIntent(createPendingIntent(context, ACTION_CLOSE))); pipMediaController.addMetadataListener(this::onMediaMetadataChanged); onConfigurationChanged(context); } @Override public void onPipEntered(String packageName) { mPackageName = packageName; Loading Loading @@ -96,25 +113,6 @@ public class PipNotification { public void onPipResizeAboutToStart() { // no-op. } }; public PipNotification(Context context, PipController pipController) { mPackageManager = context.getPackageManager(); mNotificationManager = context.getSystemService(NotificationManager.class); mNotificationBuilder = new Notification.Builder(context, NOTIFICATION_CHANNEL_TVPIP) .setLocalOnly(true) .setOngoing(false) .setCategory(Notification.CATEGORY_SYSTEM) .extend(new Notification.TvExtender() .setContentIntent(createPendingIntent(context, ACTION_MENU)) .setDeleteIntent(createPendingIntent(context, ACTION_CLOSE))); pipController.addListener(mPipListener); pipController.getPipMediaController().addMetadataListener(this::onMediaMetadataChanged); onConfigurationChanged(context); } private void onMediaMetadataChanged(MediaMetadata metadata) { if (updateMediaControllerMetadata(metadata) && mNotified) { Loading packages/SystemUI/src/com/android/systemui/wmshell/TvPipModule.java +4 −2 Original line number Diff line number Diff line Loading @@ -53,6 +53,7 @@ public abstract class TvPipModule { PipBoundsHandler pipBoundsHandler, PipTaskOrganizer pipTaskOrganizer, PipMediaController pipMediaController, PipNotification pipNotification, WindowManagerShellWrapper windowManagerShellWrapper) { return Optional.of( new PipController( Loading @@ -61,6 +62,7 @@ public abstract class TvPipModule { pipBoundsHandler, pipTaskOrganizer, pipMediaController, pipNotification, windowManagerShellWrapper)); } Loading @@ -80,8 +82,8 @@ public abstract class TvPipModule { @WMSingleton @Provides static PipNotification providePipNotification(Context context, PipController pipController) { return new PipNotification(context, pipController); PipMediaController pipMediaController) { return new PipNotification(context, pipMediaController); } @WMSingleton Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/PipController.java +4 −1 Original line number Diff line number Diff line Loading @@ -224,10 +224,11 @@ public class PipController implements Pip, PipTaskOrganizer.PipTransitionCallbac PipBoundsHandler pipBoundsHandler, PipTaskOrganizer pipTaskOrganizer, PipMediaController pipMediaController, PipNotification pipNotification, WindowManagerShellWrapper windowManagerShellWrapper) { mContext = context; mPipBoundsState = pipBoundsState; mPipNotification = new PipNotification(context, this); mPipNotification = pipNotification; mPipBoundsHandler = pipBoundsHandler; mPipMediaController = pipMediaController; // Ensure that we have the display info in case we get calls to update the bounds Loading @@ -242,6 +243,8 @@ public class PipController implements Pip, PipTaskOrganizer.PipTransitionCallbac mPipTaskOrganizer.registerPipTransitionCallback(this); mActivityTaskManager = ActivityTaskManager.getService(); addListener(mPipNotification); final IntentFilter intentFilter = new IntentFilter(); intentFilter.addAction(ACTION_CLOSE); intentFilter.addAction(ACTION_MENU); Loading
libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/PipNotification.java +37 −39 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import android.text.TextUtils; import com.android.internal.messages.nano.SystemMessageProto.SystemMessage; import com.android.wm.shell.R; import com.android.wm.shell.pip.PipMediaController; import java.util.Objects; Loading @@ -40,7 +41,7 @@ import java.util.Objects; * <p>Once it's created, it will manage the PIP notification UI by itself except for handling * configuration changes. */ public class PipNotification { public class PipNotification implements PipController.Listener { private static final boolean DEBUG = PipController.DEBUG; private static final String TAG = "PipNotification"; Loading @@ -63,7 +64,23 @@ public class PipNotification { private String mMediaTitle; private Bitmap mArt; private PipController.Listener mPipListener = new PipController.Listener() { public PipNotification(Context context, PipMediaController pipMediaController) { mPackageManager = context.getPackageManager(); mNotificationManager = context.getSystemService(NotificationManager.class); mNotificationBuilder = new Notification.Builder(context, NOTIFICATION_CHANNEL_TVPIP) .setLocalOnly(true) .setOngoing(false) .setCategory(Notification.CATEGORY_SYSTEM) .extend(new Notification.TvExtender() .setContentIntent(createPendingIntent(context, ACTION_MENU)) .setDeleteIntent(createPendingIntent(context, ACTION_CLOSE))); pipMediaController.addMetadataListener(this::onMediaMetadataChanged); onConfigurationChanged(context); } @Override public void onPipEntered(String packageName) { mPackageName = packageName; Loading Loading @@ -96,25 +113,6 @@ public class PipNotification { public void onPipResizeAboutToStart() { // no-op. } }; public PipNotification(Context context, PipController pipController) { mPackageManager = context.getPackageManager(); mNotificationManager = context.getSystemService(NotificationManager.class); mNotificationBuilder = new Notification.Builder(context, NOTIFICATION_CHANNEL_TVPIP) .setLocalOnly(true) .setOngoing(false) .setCategory(Notification.CATEGORY_SYSTEM) .extend(new Notification.TvExtender() .setContentIntent(createPendingIntent(context, ACTION_MENU)) .setDeleteIntent(createPendingIntent(context, ACTION_CLOSE))); pipController.addListener(mPipListener); pipController.getPipMediaController().addMetadataListener(this::onMediaMetadataChanged); onConfigurationChanged(context); } private void onMediaMetadataChanged(MediaMetadata metadata) { if (updateMediaControllerMetadata(metadata) && mNotified) { Loading
packages/SystemUI/src/com/android/systemui/wmshell/TvPipModule.java +4 −2 Original line number Diff line number Diff line Loading @@ -53,6 +53,7 @@ public abstract class TvPipModule { PipBoundsHandler pipBoundsHandler, PipTaskOrganizer pipTaskOrganizer, PipMediaController pipMediaController, PipNotification pipNotification, WindowManagerShellWrapper windowManagerShellWrapper) { return Optional.of( new PipController( Loading @@ -61,6 +62,7 @@ public abstract class TvPipModule { pipBoundsHandler, pipTaskOrganizer, pipMediaController, pipNotification, windowManagerShellWrapper)); } Loading @@ -80,8 +82,8 @@ public abstract class TvPipModule { @WMSingleton @Provides static PipNotification providePipNotification(Context context, PipController pipController) { return new PipNotification(context, pipController); PipMediaController pipMediaController) { return new PipNotification(context, pipMediaController); } @WMSingleton Loading