Updates destination bounds upon rotation change
This would be a bug for any PiP-enabled application if the preferred
fullscreen is in a different screen rotation than in PiP mode.
Bug: 150360003
Test: atest PinnedStackTests
Test: manually enter/exit PiP w/ Play movies app
Change-Id: Ibb56d907b9968eaf90171315faa6181a7e72b146
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 7b96268..8ada3c3 100644
--- a/packages/SystemUI/src/com/android/systemui/pip/phone/PipManager.java
+++ b/packages/SystemUI/src/com/android/systemui/pip/phone/PipManager.java
@@ -69,7 +69,6 @@
private IActivityManager mActivityManager;
private Handler mHandler = new Handler();
- private final PinnedStackListener mPinnedStackListener = new PipManagerPinnedStackListener();
private final DisplayInfo mTmpDisplayInfo = new DisplayInfo();
private final Rect mTmpInsetBounds = new Rect();
private final Rect mTmpNormalBounds = new Rect();
@@ -211,7 +210,8 @@
mActivityManager = ActivityManager.getService();
try {
- WindowManagerWrapper.getInstance().addPinnedStackListener(mPinnedStackListener);
+ WindowManagerWrapper.getInstance().addPinnedStackListener(
+ new PipManagerPinnedStackListener());
} catch (RemoteException e) {
Log.e(TAG, "Failed to register pinned stack listener", e);
}
@@ -341,7 +341,6 @@
private void updateMovementBounds(Rect animatingBounds, boolean fromImeAdjustment,
boolean fromShelfAdjustment) {
- mPipTaskOrganizer.onDisplayInfoChanged(mTmpDisplayInfo);
// Populate inset / normal bounds and DisplayInfo from mPipBoundsHandler before
// passing to mTouchHandler, mTouchHandler would rely on the bounds calculated by
// mPipBoundsHandler with up-to-dated information
@@ -350,6 +349,7 @@
mTouchHandler.onMovementBoundsChanged(mTmpInsetBounds, mTmpNormalBounds,
animatingBounds, fromImeAdjustment, fromShelfAdjustment,
mTmpDisplayInfo.rotation);
+ mPipTaskOrganizer.onDisplayInfoChanged(mTmpDisplayInfo);
}
public void dump(PrintWriter pw) {