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

Commit e8f3bfe7 authored by android-build-team Robot's avatar android-build-team Robot Committed by android-build-merger
Browse files

Merge "PIP: Fix potential stuck state" into pi-dev

am: 15317b40

Change-Id: I92dadb6108954fcb7e11316509c3d99ad4ebf822
parents a594f172 15317b40
Loading
Loading
Loading
Loading
+13 −5
Original line number Diff line number Diff line
@@ -401,12 +401,13 @@ public class BoundsAnimationController {
                + " replacing=" + replacing);

        if (replacing) {
            if (existing.isAnimatingTo(to)) {
            if (existing.isAnimatingTo(to) && (!moveToFullscreen || existing.mMoveToFullscreen)
                    && (!moveFromFullscreen || existing.mMoveFromFullscreen)) {
                // Just let the current animation complete if it has the same destination as the
                // one we are trying to start.
                if (DEBUG) Slog.d(TAG, "animateBounds: same destination as existing=" + existing
                        + " ignoring...");

                // one we are trying to start, and, if moveTo/FromFullscreen was requested, already
                // has that flag set.
                if (DEBUG) Slog.d(TAG, "animateBounds: same destination and moveTo/From flags as "
                        + "existing=" + existing + ", ignoring...");
                return existing;
            }

@@ -434,6 +435,13 @@ public class BoundsAnimationController {
                }
            }

            // We need to keep the previous moveTo/FromFullscreen flag, unless the new animation
            // specifies a direction.
            if (!moveFromFullscreen && !moveToFullscreen) {
                moveToFullscreen = existing.mMoveToFullscreen;
                moveFromFullscreen = existing.mMoveFromFullscreen;
            }

            // Since we are replacing, we skip both animation start and end callbacks
            existing.cancel();
        }
+1 −1
Original line number Diff line number Diff line
@@ -545,7 +545,7 @@ public class BoundsAnimationControllerTests extends WindowTestsBase {
                .restart(BOUNDS_SMALLER_FLOATING,
                        false /* expectStartedAndPipModeChangedCallback */)
                .end()
                .expectEnded(SCHEDULE_PIP_MODE_CHANGED, !MOVE_TO_FULLSCREEN);
                .expectEnded(SCHEDULE_PIP_MODE_CHANGED, MOVE_TO_FULLSCREEN);
    }

    /** !F->!F w/ CANCEL **/