summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Mateusz Cicheński <mateuszc@google.com> 2022-11-30 22:03:41 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2022-11-30 22:03:41 +0000
commitd7f99f6c63709099e959db57cb62cc196b9f0584 (patch)
tree57b392527dbbb640a62e9693df80c45c581440db
parent4bd41537f3561334033ecfbd2ac6e073aeee3e17 (diff)
parent8d917f9e7eb6be1a44ac4741eed346dd657770b3 (diff)
Merge "Fix the regression of PiP position in fixed rotation" into tm-qpr-dev
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java
index d28a9f3cf8ff..efe938f0a274 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java
@@ -612,12 +612,21 @@ public class PipController implements PipTransitionController.PipTransitionCallb
new DisplayInsetsController.OnInsetsChangedListener() {
@Override
public void insetsChanged(InsetsState insetsState) {
+ DisplayLayout pendingLayout =
+ mDisplayController.getDisplayLayout(mPipBoundsState.getDisplayId());
+ if (mIsInFixedRotation
+ || pendingLayout.rotation()
+ != mPipBoundsState.getDisplayLayout().rotation()) {
+ // bail out if there is a pending rotation or fixed rotation change
+ return;
+ }
int oldMaxMovementBound = mPipBoundsState.getMovementBounds().bottom;
onDisplayChanged(
mDisplayController.getDisplayLayout(mPipBoundsState.getDisplayId()),
false /* saveRestoreSnapFraction */);
int newMaxMovementBound = mPipBoundsState.getMovementBounds().bottom;
if (!mEnablePipKeepClearAlgorithm) {
+ // offset PiP to adjust for bottom inset change
int pipTop = mPipBoundsState.getBounds().top;
int diff = newMaxMovementBound - oldMaxMovementBound;
if (diff < 0 && pipTop > newMaxMovementBound) {