From 3c5193079644277c3195eaaff106c4611d427673 Mon Sep 17 00:00:00 2001 From: Wale Ogunwale Date: Thu, 14 Jul 2016 09:17:59 -0700 Subject: [PATCH] Allow no longer waiting for visible activity to be stopped. When process the stop list we remove an activity that was previously waiting for visible and is now visible from the list and also hide its windows if it is finishing. However, we don't transition it to the stopped state because it was waiting for visible. If it is finishing and the windows are hidden then it makes sense to transition it into the stopped state since it will not be visible to the user again. Bug: 30058392 Change-Id: Iac81e2877716ae58d05aed42e1433190a2f70428 --- .../java/com/android/server/am/ActivityStackSupervisor.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/am/ActivityStackSupervisor.java b/services/core/java/com/android/server/am/ActivityStackSupervisor.java index a4fc251b70d87..c16fc62d1177c 100644 --- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java +++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java @@ -3074,7 +3074,7 @@ public final class ActivityStackSupervisor implements DisplayListener { final boolean nowVisible = allResumedActivitiesVisible(); for (int activityNdx = mStoppingActivities.size() - 1; activityNdx >= 0; --activityNdx) { ActivityRecord s = mStoppingActivities.get(activityNdx); - final boolean waitingVisible = mWaitingVisibleActivities.contains(s); + boolean waitingVisible = mWaitingVisibleActivities.contains(s); if (DEBUG_STATES) Slog.v(TAG, "Stopping " + s + ": nowVisible=" + nowVisible + " waitingVisible=" + waitingVisible + " finishing=" + s.finishing); if (waitingVisible && nowVisible) { @@ -3087,6 +3087,7 @@ public final class ActivityStackSupervisor implements DisplayListener { // hidden by the activities in front of it. if (DEBUG_STATES) Slog.v(TAG, "Before stopping, can hide: " + s); mWindowManager.setAppVisibility(s.appToken, false); + waitingVisible = false; } } if ((!waitingVisible || mService.isSleepingOrShuttingDownLocked()) && remove) {