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

Commit 161ea3e6 authored by chaviw's avatar chaviw
Browse files

Use WS pending transaction for MoveAnimation

MoveAnimation updates the WS.surfaceControl position at the start of the
animation. Use the WS pending transaction instead of display so there
aren't two transactions updating the same property on the same SC.

Fixes: 72646189
Test: Open IME from secondary app in split screen. Hit home and then
open primary into full screen. Position for primary app should be
correct.
Test: go/wm-smoke-auto

Change-Id: Ie034756b615550d0f351281764e93fa2863a559b
parent cf40a9ab
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -662,7 +662,7 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
            mWallpaperController.updateWallpaperVisibility();
        }

        w.handleWindowMovedIfNeeded(mPendingTransaction);
        w.handleWindowMovedIfNeeded();

        final WindowStateAnimator winAnimator = w.mWinAnimator;

+4 −4
Original line number Diff line number Diff line
@@ -1758,7 +1758,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
     * listeners and optionally animate it. Simply checking a change of position is not enough,
     * because being move due to dock divider is not a trigger for animation.
     */
    void handleWindowMovedIfNeeded(Transaction t) {
    void handleWindowMovedIfNeeded() {
        if (!hasMoved()) {
            return;
        }
@@ -1776,7 +1776,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
                && !isDragResizing() && !adjustedForMinimizedDockOrIme
                && getWindowConfiguration().hasMovementAnimations()
                && !mWinAnimator.mLastHidden) {
            startMoveAnimation(t, left, top);
            startMoveAnimation(left, top);
        }

        //TODO (multidisplay): Accessibility supported only for the default display.
@@ -4360,7 +4360,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        commitPendingTransaction();
    }

    private void startMoveAnimation(Transaction t, int left, int top) {
    private void startMoveAnimation(int left, int top) {
        if (DEBUG_ANIM) Slog.v(TAG, "Setting move animation on " + this);
        final Point oldPosition = new Point();
        final Point newPosition = new Point();
@@ -4369,7 +4369,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        final AnimationAdapter adapter = new LocalAnimationAdapter(
                new MoveAnimationSpec(oldPosition.x, oldPosition.y, newPosition.x, newPosition.y),
                mService.mSurfaceAnimationRunner);
        startAnimation(t, adapter);
        startAnimation(getPendingTransaction(), adapter);
    }

    private void startAnimation(Transaction t, AnimationAdapter adapter) {