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

Commit 724c1c3c authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Skip deferring draw for non seamless rotation window

Otherwise even if keepAppearanceInPreviousRotation is not called,
the draw transaction requested by InsetsSourceProvider#onPostLayout
may still be deferred with start transaction of transition even if
blast group sync is off.

Bug: 247856453
Test: TransitionTests#testDisplayRotationChange

Change-Id: I8360ab65d886e86351c3fa3ffcbff5ec88accedb
Merged-In: I8360ab65d886e86351c3fa3ffcbff5ec88accedb
parent 36f16a2f
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -202,8 +202,7 @@ class AsyncRotationController extends FadeAnimationController implements Consume
        // target windows. But the windows still need to use sync transaction to keep the appearance
        // in previous rotation, so request a no-op sync to keep the state.
        for (int i = mTargetWindowTokens.size() - 1; i >= 0; i--) {
            if (TransitionController.SYNC_METHOD != BLASTSyncEngine.METHOD_BLAST
                    && mTargetWindowTokens.valueAt(i).mAction != Operation.ACTION_SEAMLESS) {
            if (mTargetWindowTokens.valueAt(i).canDrawBeforeStartTransaction()) {
                // Expect a screenshot layer will cover the non seamless windows.
                continue;
            }
@@ -489,7 +488,7 @@ class AsyncRotationController extends FadeAnimationController implements Consume
            return false;
        }
        final Operation op = mTargetWindowTokens.get(w.mToken);
        if (op == null) return false;
        if (op == null || op.canDrawBeforeStartTransaction()) return false;
        if (DEBUG) Slog.d(TAG, "handleFinishDrawing " + w);
        if (op.mDrawTransaction == null) {
            if (w.isClientLocal()) {
@@ -554,5 +553,14 @@ class AsyncRotationController extends FadeAnimationController implements Consume
        Operation(@Action int action) {
            mAction = action;
        }

        /**
         * Returns {@code true} if the corresponding window can draw its latest content before the
         * start transaction of rotation transition is applied.
         */
        boolean canDrawBeforeStartTransaction() {
            return TransitionController.SYNC_METHOD != BLASTSyncEngine.METHOD_BLAST
                    && mAction != ACTION_SEAMLESS;
        }
    }
}
+5 −0
Original line number Diff line number Diff line
@@ -732,6 +732,11 @@ public class TransitionTests extends WindowTestsBase {
        assertTrue(asyncRotationController.isTargetToken(decorToken));
        assertShouldFreezeInsetsPosition(asyncRotationController, statusBar, true);

        if (TransitionController.SYNC_METHOD != BLASTSyncEngine.METHOD_BLAST) {
            // Only seamless window syncs its draw transaction with transition.
            assertFalse(asyncRotationController.handleFinishDrawing(statusBar, mMockT));
            assertTrue(asyncRotationController.handleFinishDrawing(screenDecor, mMockT));
        }
        screenDecor.setOrientationChanging(false);
        // Status bar finishes drawing before the start transaction. Its fade-in animation will be
        // executed until the transaction is committed, so it is still in target tokens.