Stops the activities in the forward order

The activities were added to the stopping list usually from
top to bottom. Since the stopping list is processed in a reverse
order, the activities were put to stopped state reversely.

Bug: 262077896
Test: verify locally
Change-Id: I561bb5887b0d4ab46841845fa6472a8aaee4d6c0
This commit is contained in:
Louis Chang
2023-02-04 04:43:06 +00:00
parent 437bb6da33
commit 46443aae56

View File

@@ -2053,7 +2053,7 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks {
// Stop any activities that are scheduled to do so but have been waiting for the transition
// animation to finish.
ArrayList<ActivityRecord> readyToStopActivities = null;
for (int i = mStoppingActivities.size() - 1; i >= 0; --i) {
for (int i = 0; i < mStoppingActivities.size(); i++) {
final ActivityRecord s = mStoppingActivities.get(i);
final boolean animating = s.isInTransition();
ProtoLog.v(WM_DEBUG_STATES, "Stopping %s: nowVisible=%b animating=%b "
@@ -2074,6 +2074,7 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks {
readyToStopActivities.add(s);
mStoppingActivities.remove(i);
i--;
}
}