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

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

Merge "Do not notify transition finish for a initializing activity" into udc-dev am: c645d5d2

parents 1db057ad c645d5d2
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -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);
            }
        }
+10 −0
Original line number Diff line number Diff line
@@ -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