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

Commit 0411c060 authored by Riddle Hsu's avatar Riddle Hsu Committed by Automerger Merge Worker
Browse files

Merge "Disable freeze insets for non blast sync shell transition" into tm-qpr-dev am: d9e5e14c

parents 678bb88d d9e5e14c
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -357,7 +357,12 @@ class AsyncRotationController extends FadeAnimationController implements Consume
     * or seamless transformation in a rotated display.
     */
    boolean shouldFreezeInsetsPosition(WindowState w) {
        return mTransitionOp != OP_LEGACY && w.mTransitionController.inTransition()
        if (TransitionController.SYNC_METHOD != BLASTSyncEngine.METHOD_BLAST) {
            // Expect a screenshot layer has covered the screen, so it is fine to let client side
            // insets animation runner update the position directly.
            return false;
        }
        return mTransitionOp != OP_LEGACY && !mIsStartTransactionCommitted
                && isTargetToken(w.mToken);
    }

+13 −3
Original line number Diff line number Diff line
@@ -729,7 +729,7 @@ public class TransitionTests extends WindowTestsBase {
        assertTrue(ime.mToken.inTransition());
        assertTrue(task.inTransition());
        assertTrue(asyncRotationController.isTargetToken(decorToken));
        assertTrue(asyncRotationController.shouldFreezeInsetsPosition(navBar));
        assertShouldFreezeInsetsPosition(asyncRotationController, statusBar, true);

        screenDecor.setOrientationChanging(false);
        // Status bar finishes drawing before the start transaction. Its fade-in animation will be
@@ -744,6 +744,7 @@ public class TransitionTests extends WindowTestsBase {
        // The transaction is committed, so fade-in animation for status bar is consumed.
        transactionCommittedListener.onTransactionCommitted();
        assertFalse(asyncRotationController.isTargetToken(statusBar.mToken));
        assertShouldFreezeInsetsPosition(asyncRotationController, navBar, false);

        // Navigation bar finishes drawing after the start transaction, so its fade-in animation
        // can execute directly.
@@ -779,7 +780,7 @@ public class TransitionTests extends WindowTestsBase {
        final AsyncRotationController asyncRotationController =
                mDisplayContent.getAsyncRotationController();
        assertNotNull(asyncRotationController);
        assertTrue(asyncRotationController.shouldFreezeInsetsPosition(statusBar));
        assertShouldFreezeInsetsPosition(asyncRotationController, statusBar, true);

        statusBar.setOrientationChanging(true);
        player.startTransition();
@@ -825,7 +826,7 @@ public class TransitionTests extends WindowTestsBase {
        final AsyncRotationController asyncRotationController =
                mDisplayContent.getAsyncRotationController();
        assertNotNull(asyncRotationController);
        assertTrue(asyncRotationController.shouldFreezeInsetsPosition(statusBar));
        assertShouldFreezeInsetsPosition(asyncRotationController, statusBar, true);
        assertTrue(app.getTask().inTransition());

        player.start();
@@ -860,6 +861,15 @@ public class TransitionTests extends WindowTestsBase {
        assertNull(mDisplayContent.getAsyncRotationController());
    }

    private static void assertShouldFreezeInsetsPosition(AsyncRotationController controller,
            WindowState w, boolean freeze) {
        if (TransitionController.SYNC_METHOD != BLASTSyncEngine.METHOD_BLAST) {
            // Non blast sync should never freeze insets position.
            freeze = false;
        }
        assertEquals(freeze, controller.shouldFreezeInsetsPosition(w));
    }

    @Test
    public void testDeferRotationForTransientLaunch() {
        final TestTransitionPlayer player = registerTestTransitionPlayer();