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

Commit e4a85d9f authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Merge "Disable freeze insets for non blast sync shell transition" into...

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

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19953145



Change-Id: I3a5a62a8f3fa71ff9dcf1a59fb6e36f0c8c6c6b3
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 7815cd1c a3cb49b2
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
@@ -732,7 +732,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
@@ -747,6 +747,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.
@@ -782,7 +783,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();
@@ -828,7 +829,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();
@@ -863,6 +864,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();