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

Commit b5014805 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

am: a5aa3ecb

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

Change-Id: Ie30b39ce86c696f762135e71ebe8f9bf7c173758
parents fd5affdc a5aa3ecb
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);
                }
            }