Showing notification when activity is in PiP.
- Adding callback to SystemUI to be notified which package entered PiP,
and when it leaves PiP.
- Showing a BTW notification on a new PiP-specific channel.
Bug: 36070720
Test: Launch PiP, observe notification, leave PiP, observe no notification
Change-Id: Ibe10298288fe0464d7d136f2571e855f3f5c70ea
diff --git a/packages/SystemUI/src/com/android/systemui/pip/phone/PipManager.java b/packages/SystemUI/src/com/android/systemui/pip/phone/PipManager.java
index ecc2fad..6cda076 100644
--- a/packages/SystemUI/src/com/android/systemui/pip/phone/PipManager.java
+++ b/packages/SystemUI/src/com/android/systemui/pip/phone/PipManager.java
@@ -56,6 +56,7 @@
private InputConsumerController mInputConsumerController;
private PipMenuActivityController mMenuController;
private PipMediaController mMediaController;
+ private PipNotificationController mNotificationController;
private PipTouchHandler mTouchHandler;
/**
@@ -63,13 +64,24 @@
*/
TaskStackListener mTaskStackListener = new TaskStackListener() {
@Override
- public void onActivityPinned() {
+ public void onActivityPinned(String packageName) {
if (!checkCurrentUserId(false /* debug */)) {
return;
}
+
mTouchHandler.onActivityPinned();
mMediaController.onActivityPinned();
mMenuController.onActivityPinned();
+ mNotificationController.onActivityPinned(packageName);
+ }
+
+ @Override
+ public void onActivityUnpinned() {
+ if (!checkCurrentUserId(false /* debug */)) {
+ return;
+ }
+
+ mNotificationController.onActivityUnpinned();
}
@Override
@@ -160,6 +172,7 @@
mInputConsumerController);
mTouchHandler = new PipTouchHandler(context, mActivityManager, mMenuController,
mInputConsumerController);
+ mNotificationController = new PipNotificationController(context, mActivityManager);
}
/**