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

Commit 16626c1b 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

am: 2c3f7911

* commit '2c3f7911':
  Fixed a concurrent modification crash

Change-Id: I39be1879854f1f09494e5965e7fed275a9546213
parents 802ce755 2c3f7911
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);
            }