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

Commit 785ea5ea authored by Riddle Hsu's avatar Riddle Hsu Committed by Android (Google) Code Review
Browse files

Merge "Pause insets position for seamless rotation" into main

parents 5015a63d 42ef04ea
Loading
Loading
Loading
Loading
+7 −2
Original line number Original line Diff line number Diff line
@@ -290,7 +290,7 @@ class AsyncRotationController extends FadeAnimationController implements Consume
        }
        }
        // The insets position may be frozen by shouldFreezeInsetsPosition(), so refresh the
        // The insets position may be frozen by shouldFreezeInsetsPosition(), so refresh the
        // position to the latest state when it is ready to show in new rotation.
        // position to the latest state when it is ready to show in new rotation.
        if (mTransitionOp == OP_APP_SWITCH) {
        if (isSeamlessTransition()) {
            for (int i = windowToken.getChildCount() - 1; i >= 0; i--) {
            for (int i = windowToken.getChildCount() - 1; i >= 0; i--) {
                final WindowState w = windowToken.getChildAt(i);
                final WindowState w = windowToken.getChildAt(i);
                final InsetsSourceProvider insetsProvider = w.getControllableInsetProvider();
                final InsetsSourceProvider insetsProvider = w.getControllableInsetProvider();
@@ -506,11 +506,16 @@ class AsyncRotationController extends FadeAnimationController implements Consume
    boolean shouldFreezeInsetsPosition(WindowState w) {
    boolean shouldFreezeInsetsPosition(WindowState w) {
        // Non-change transition (OP_APP_SWITCH) and METHOD_BLAST don't use screenshot so the
        // Non-change transition (OP_APP_SWITCH) and METHOD_BLAST don't use screenshot so the
        // insets should keep original position before the start transaction is applied.
        // insets should keep original position before the start transaction is applied.
        return mTransitionOp != OP_LEGACY && (mTransitionOp == OP_APP_SWITCH
        return mTransitionOp != OP_LEGACY && (isSeamlessTransition()
                || TransitionController.SYNC_METHOD == BLASTSyncEngine.METHOD_BLAST)
                || TransitionController.SYNC_METHOD == BLASTSyncEngine.METHOD_BLAST)
                && !mIsStartTransactionCommitted && canBeAsync(w.mToken) && isTargetToken(w.mToken);
                && !mIsStartTransactionCommitted && canBeAsync(w.mToken) && isTargetToken(w.mToken);
    }
    }


    /** Returns true if there won't be a screen rotation animation (screenshot-based). */
    private boolean isSeamlessTransition() {
        return mTransitionOp == OP_APP_SWITCH || mTransitionOp == OP_CHANGE_MAY_SEAMLESS;
    }

    /**
    /**
     * Returns the transaction which will be applied after the window redraws in new rotation.
     * Returns the transaction which will be applied after the window redraws in new rotation.
     * This is used to update the position of insets animation leash synchronously.
     * This is used to update the position of insets animation leash synchronously.