Merge "Report enterAnimationComplete when transient launch is committed" into tm-qpr-dev
This commit is contained in:
@@ -735,6 +735,10 @@ class Transition extends Binder implements BLASTSyncEngine.TransactionReadyListe
|
|||||||
if (mChanges.get(ar).mVisible != visibleAtTransitionEnd) {
|
if (mChanges.get(ar).mVisible != visibleAtTransitionEnd) {
|
||||||
// Legacy dispatch relies on this (for now).
|
// Legacy dispatch relies on this (for now).
|
||||||
ar.mEnteringAnimation = visibleAtTransitionEnd;
|
ar.mEnteringAnimation = visibleAtTransitionEnd;
|
||||||
|
} else if (mTransientLaunches != null && mTransientLaunches.containsKey(ar)
|
||||||
|
&& ar.isVisible()) {
|
||||||
|
// Transient launch was committed, so report enteringAnimation
|
||||||
|
ar.mEnteringAnimation = true;
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -964,8 +964,17 @@ public class TransitionTests extends WindowTestsBase {
|
|||||||
@Test
|
@Test
|
||||||
public void testTransientLaunch() {
|
public void testTransientLaunch() {
|
||||||
final TaskSnapshotController snapshotController = mock(TaskSnapshotController.class);
|
final TaskSnapshotController snapshotController = mock(TaskSnapshotController.class);
|
||||||
|
final ArrayList<ActivityRecord> enteringAnimReports = new ArrayList<>();
|
||||||
final TransitionController controller = new TransitionController(mAtm, snapshotController,
|
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();
|
final ITransitionPlayer player = new ITransitionPlayer.Default();
|
||||||
controller.registerTransitionPlayer(player, null /* playerProc */);
|
controller.registerTransitionPlayer(player, null /* playerProc */);
|
||||||
final Transition openTransition = controller.createTransition(TRANSIT_OPEN);
|
final Transition openTransition = controller.createTransition(TRANSIT_OPEN);
|
||||||
@@ -1010,6 +1019,7 @@ public class TransitionTests extends WindowTestsBase {
|
|||||||
|
|
||||||
activity1.mVisibleRequested = false;
|
activity1.mVisibleRequested = false;
|
||||||
activity2.mVisibleRequested = true;
|
activity2.mVisibleRequested = true;
|
||||||
|
activity2.setVisible(true);
|
||||||
|
|
||||||
// Using abort to force-finish the sync (since we obviously can't wait for drawing).
|
// 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
|
// We didn't call abort on the actual transition, so it will still run onTransactionReady
|
||||||
@@ -1020,9 +1030,11 @@ public class TransitionTests extends WindowTestsBase {
|
|||||||
// called until finish).
|
// called until finish).
|
||||||
verify(snapshotController, times(0)).recordTaskSnapshot(eq(task1), eq(false));
|
verify(snapshotController, times(0)).recordTaskSnapshot(eq(task1), eq(false));
|
||||||
|
|
||||||
|
enteringAnimReports.clear();
|
||||||
closeTransition.finishTransition();
|
closeTransition.finishTransition();
|
||||||
|
|
||||||
verify(snapshotController, times(1)).recordTaskSnapshot(eq(task1), eq(false));
|
verify(snapshotController, times(1)).recordTaskSnapshot(eq(task1), eq(false));
|
||||||
|
assertTrue(enteringAnimReports.contains(activity2));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
Reference in New Issue
Block a user