Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 265ee855 authored by Mateusz Cicheński's avatar Mateusz Cicheński Committed by Automerger Merge Worker
Browse files

Merge "Fix the regression of PiP position in fixed rotation" into tm-qpr-dev...

Merge "Fix the regression of PiP position in fixed rotation" into tm-qpr-dev am: d7f99f6c am: cad25dc1

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20587097



Change-Id: I47b7e0c74bff72069038126b19a0281e0e7c604f
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 89b5aa84 cad25dc1
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -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) {