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

Commit 52467f6e authored by Evan Rosky's avatar Evan Rosky Committed by Automerger Merge Worker
Browse files

Merge "Report enterAnimationComplete when transient launch is committed" into...

Merge "Report enterAnimationComplete when transient launch is committed" into tm-qpr-dev am: 505bcd28 am: 48416ce4

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



Change-Id: I8a0f0bcb8c34968560a8f5c97da7661306c42889
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 23b4592f 48416ce4
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -727,6 +727,10 @@ class Transition extends Binder implements BLASTSyncEngine.TransactionReadyListe
                if (mChanges.get(ar).mVisible != visibleAtTransitionEnd) {
                    // Legacy dispatch relies on this (for now).
                    ar.mEnteringAnimation = visibleAtTransitionEnd;
                } else if (mTransientLaunches != null && mTransientLaunches.containsKey(ar)
                        && ar.isVisible()) {
                    // Transient launch was committed, so report enteringAnimation
                    ar.mEnteringAnimation = true;
                }
                continue;
            }
+13 −1
Original line number Diff line number Diff line
@@ -967,8 +967,17 @@ public class TransitionTests extends WindowTestsBase {
    @Test
    public void testTransientLaunch() {
        final TaskSnapshotController snapshotController = mock(TaskSnapshotController.class);
        final ArrayList<ActivityRecord> enteringAnimReports = new ArrayList<>();
        final TransitionController controller = new TransitionController(mAtm, snapshotController,
                mock(TransitionTracer.class));
                mock(TransitionTracer.class)) {
            @Override
            protected void dispatchLegacyAppTransitionFinished(ActivityRecord ar) {
                if (ar.mEnteringAnimation) {
                    enteringAnimReports.add(ar);
                }
                super.dispatchLegacyAppTransitionFinished(ar);
            }
        };
        final ITransitionPlayer player = new ITransitionPlayer.Default();
        controller.registerTransitionPlayer(player, null /* playerProc */);
        final Transition openTransition = controller.createTransition(TRANSIT_OPEN);
@@ -1013,6 +1022,7 @@ public class TransitionTests extends WindowTestsBase {

        activity1.mVisibleRequested = false;
        activity2.mVisibleRequested = true;
        activity2.setVisible(true);

        // Using abort to force-finish the sync (since we obviously can't wait for drawing).
        // We didn't call abort on the actual transition, so it will still run onTransactionReady
@@ -1023,9 +1033,11 @@ public class TransitionTests extends WindowTestsBase {
        // called until finish).
        verify(snapshotController, times(0)).recordTaskSnapshot(eq(task1), eq(false));

        enteringAnimReports.clear();
        closeTransition.finishTransition();

        verify(snapshotController, times(1)).recordTaskSnapshot(eq(task1), eq(false));
        assertTrue(enteringAnimReports.contains(activity2));
    }

    @Test