Fix IndexOutOfBoundsException while handle app crash
The `mActivities` size could change while the the activity is detached (r.detachFromProcess). Bug: 274859740 Test: wm presubmit Change-Id: I05d7b5a79d3f7cffca707a7ad7cce1b871f0c8ff
This commit is contained in:
@@ -378,8 +378,9 @@ public class WindowProcessController extends ConfigurationContainer<Configuratio
|
||||
}
|
||||
|
||||
void handleAppCrash() {
|
||||
for (int i = mActivities.size() - 1; i >= 0; --i) {
|
||||
final ActivityRecord r = mActivities.get(i);
|
||||
ArrayList<ActivityRecord> activities = new ArrayList<>(mActivities);
|
||||
for (int i = activities.size() - 1; i >= 0; --i) {
|
||||
final ActivityRecord r = activities.get(i);
|
||||
Slog.w(TAG, " Force finishing activity "
|
||||
+ r.mActivityComponent.flattenToShortString());
|
||||
r.detachFromProcess();
|
||||
|
||||
Reference in New Issue
Block a user