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

Commit 0683868c authored by Evan Rosky's avatar Evan Rosky
Browse files

Schedule lifecycle-stops after every transition

Was trying to limit it only to transitions with "closing"
activities; however, this doesn't work if a new transition is
created before the relevant transition finishes (eg. during
fixed-rotation). So, just always attempt to schedule. This
should be ok because the schedule method already no-ops if
there are no pending-stopped activities.

Bug: 230531683
Test: atest AppConfigurationTests#testAppOrientationRequestConfigChanges
Change-Id: I82cc9dc51291e727736d2b6a6feda1a6d171d235
parent b7b5337c
Loading
Loading
Loading
Loading
+4 −8
Original line number Diff line number Diff line
@@ -490,7 +490,6 @@ class Transition extends Binder implements BLASTSyncEngine.TransactionReadyListe
        }

        // Commit all going-invisible containers
        boolean activitiesWentInvisible = false;
        for (int i = 0; i < mParticipants.size(); ++i) {
            final ActivityRecord ar = mParticipants.valueAt(i).asActivityRecord();
            if (ar != null) {
@@ -541,7 +540,6 @@ class Transition extends Binder implements BLASTSyncEngine.TransactionReadyListe
                        }
                        ar.commitVisibility(false /* visible */, false /* performLayout */,
                                true /* fromTransition */);
                        activitiesWentInvisible = true;
                    }
                }
                if (mChanges.get(ar).mVisible != visibleAtTransitionEnd) {
@@ -568,12 +566,10 @@ class Transition extends Binder implements BLASTSyncEngine.TransactionReadyListe
                mController.dispatchLegacyAppTransitionFinished(ar);
            }
        }
        if (activitiesWentInvisible) {
        // Always schedule stop processing when transition finishes because activities don't
        // stop while they are in a transition thus their stop could still be pending.
        mController.mAtm.mTaskSupervisor
                .scheduleProcessStoppingAndFinishingActivitiesIfNeeded();
        }

        sendRemoteCallback(mClientAnimationFinishCallback);