Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2c3f7911 authored by Selim Cinek's avatar Selim Cinek Committed by android-build-merger
Browse files

Merge "Fixed a concurrent modification crash" into nyc-dev

am: f9f48ecd

* commit 'f9f48ecd':
  Fixed a concurrent modification crash

Change-Id: I776698ffa8378e634554674e29dccea486b6cb13
parents e163ac23 f9f48ecd
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ import com.android.systemui.statusbar.policy.HeadsUpManager;

import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
@@ -239,7 +240,12 @@ public class NotificationGroupManager implements HeadsUpManager.OnHeadsUpChanged
    }

    public void collapseAllGroups() {
        for (NotificationGroup group : mGroupMap.values()) {
        // Because notifications can become isolated when the group becomes suppressed it can
        // lead to concurrent modifications while looping. We need to make a copy.
        ArrayList<NotificationGroup> groupCopy = new ArrayList<>(mGroupMap.values());
        int size = groupCopy.size();
        for (int i = 0; i < size; i++) {
            NotificationGroup group =  groupCopy.get(i);
            if (group.expanded) {
                setGroupExpanded(group, false);
            }