Do not add duplicates to mWaitingVisibleActivities
processStoppingActivitiesLocked() only removes one record each time, so
instead of stopping on the next window visible (or next idle), it now
requires two such calls to move the app to destroyed, if there's only
one report, the app never gets removed.
bug: 28417200
Change-Id: I7c5eac240074ed0434a72643a8d52f1726ab906c
diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java
index 37bd401..564cea7 100644
--- a/services/core/java/com/android/server/am/ActivityStack.java
+++ b/services/core/java/com/android/server/am/ActivityStack.java
@@ -3438,7 +3438,9 @@
mWindowManager.prepareAppTransition(transit, false);
mWindowManager.setAppVisibility(r.appToken, false);
mWindowManager.executeAppTransition();
- mStackSupervisor.mWaitingVisibleActivities.add(r);
+ if (!mStackSupervisor.mWaitingVisibleActivities.contains(r)) {
+ mStackSupervisor.mWaitingVisibleActivities.add(r);
+ }
}
return finishCurrentActivityLocked(r, (r.visible || r.nowVisible) ?
FINISH_AFTER_VISIBLE : FINISH_AFTER_PAUSE, oomAdj) == null;