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
This commit is contained in:
Wale Ogunwale
2016-07-14 09:17:59 -07:00
parent ebfa6df9a0
commit 3c51930796

View File

@@ -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) {