Merge "Do not notify transition finish for a initializing activity" into udc-dev
This commit is contained in:
@@ -1190,7 +1190,11 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
|
||||
// processed all the participants first (in particular, we want to trigger pip-enter first)
|
||||
for (int i = 0; i < mParticipants.size(); ++i) {
|
||||
final ActivityRecord ar = mParticipants.valueAt(i).asActivityRecord();
|
||||
if (ar != null) {
|
||||
// If the activity was just inserted to an invisible task, it will keep INITIALIZING
|
||||
// state. Then no need to notify the callback to avoid clearing some states
|
||||
// unexpectedly, e.g. launch-task-behind.
|
||||
if (ar != null && (ar.isVisibleRequested()
|
||||
|| !ar.isState(ActivityRecord.State.INITIALIZING))) {
|
||||
mController.dispatchLegacyAppTransitionFinished(ar);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1346,6 +1346,16 @@ public class TransitionTests extends WindowTestsBase {
|
||||
activity1.setVisible(false);
|
||||
abortTransition.abort();
|
||||
assertTrue(activity1.isVisible());
|
||||
|
||||
// The mLaunchTaskBehind flag of an invisible initializing activity should not be cleared.
|
||||
final Transition noChangeTransition = controller.createTransition(TRANSIT_OPEN);
|
||||
noChangeTransition.collect(activity1);
|
||||
activity1.setVisibleRequested(false);
|
||||
activity1.setState(ActivityRecord.State.INITIALIZING, "test");
|
||||
activity1.mLaunchTaskBehind = true;
|
||||
mWm.mSyncEngine.abort(noChangeTransition.getSyncId());
|
||||
noChangeTransition.finishTransition();
|
||||
assertTrue(activity1.mLaunchTaskBehind);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user