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

Commit 2e0d5470 authored by Andrii Kulian's avatar Andrii Kulian Committed by android-build-merger
Browse files

Merge "Fix onStop not called when activity is under translucent" into nyc-dev...

Merge "Fix onStop not called when activity is under translucent" into nyc-dev am: a5aa3ecb am: b5014805
am: 721e458d

* commit '721e458d':
  Fix onStop not called when activity is under translucent

Change-Id: I8d46ecce5ae6efd9845a43826347497fade72dcd
parents 6b30f04e 721e458d
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -1008,13 +1008,14 @@ final class ActivityStack {
    void goToSleep() {
        ensureActivitiesVisibleLocked(null, 0, !PRESERVE_WINDOWS);

        // Make sure any stopped but visible activities are now sleeping.
        // Make sure any paused or stopped but visible activities are now sleeping.
        // This ensures that the activity's onStop() is called.
        for (int taskNdx = mTaskHistory.size() - 1; taskNdx >= 0; --taskNdx) {
            final ArrayList<ActivityRecord> activities = mTaskHistory.get(taskNdx).mActivities;
            for (int activityNdx = activities.size() - 1; activityNdx >= 0; --activityNdx) {
                final ActivityRecord r = activities.get(activityNdx);
                if (r.state == ActivityState.STOPPING || r.state == ActivityState.STOPPED) {
                if (r.state == ActivityState.STOPPING || r.state == ActivityState.STOPPED
                        || r.state == ActivityState.PAUSED || r.state == ActivityState.PAUSING) {
                    r.setSleeping(true);
                }
            }