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

Commit 48a08206 authored by Hongwei Wang's avatar Hongwei Wang
Browse files

Skip onMovementBoundsChanged when waiting for fixed rotation

When entering PiP from landscape mode with non-default aspect ratio, the
onMovementBoundsChanged callback will try to reset the surface with the
default bounds. Skip it if we are waiting for fixed rotation to be
completed, similar to the exiting swipe-pip-to-home check.

Video: http://recall/-/aaaaaabFQoRHlzixHdtY/cTmovQdIAyqu5rCrJGtf0q
Bug: 190651955
Test: follow the reproduce steps, see video
Change-Id: I71a427351f5e080b4307ebe0a30659a3617d4a58
parent 4e46adb8
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -833,10 +833,14 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener,
    public void onMovementBoundsChanged(Rect destinationBoundsOut, boolean fromRotation,
            boolean fromImeAdjustment, boolean fromShelfAdjustment,
            WindowContainerTransaction wct) {
        // note that this can be called when swiping pip to home is happening. For instance,
        // swiping an app in landscape to portrait home. skip this entirely if that's the case.
        if (mInSwipePipToHomeTransition && fromRotation) {
            if (DEBUG) Log.d(TAG, "skip onMovementBoundsChanged due to swipe-pip-to-home");
        // note that this can be called when swipe-to-home or fixed-rotation is happening.
        // Skip this entirely if that's the case.
        if ((mInSwipePipToHomeTransition || mWaitForFixedRotation) && fromRotation) {
            if (DEBUG) {
                Log.d(TAG, "Skip onMovementBoundsChanged on rotation change"
                        + " mInSwipePipToHomeTransition=" + mInSwipePipToHomeTransition
                        + " mWaitForFixedRotation=" + mWaitForFixedRotation);
            }
            return;
        }
        final PipAnimationController.PipTransitionAnimator animator =