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

Commit c969dcbb authored by Josh Tsuji's avatar Josh Tsuji Committed by Automerger Merge Worker
Browse files

Merge "Avoid another concurrent modification exception in ShortcutHelper."...

Merge "Avoid another concurrent modification exception in ShortcutHelper." into rvc-dev am: 831ac87a am: ed1fd6a0

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12047870

Change-Id: Iaedd3957533315b032246fddc344a946b5a75487
parents a4b2b6a6 ed1fd6a0
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -102,9 +102,13 @@ public class ShortcutHelper {
            HashMap<String, String> shortcutBubbles = mActiveShortcutBubbles.get(packageName);
            ArrayList<String> bubbleKeysToRemove = new ArrayList<>();
            if (shortcutBubbles != null) {
                // Copy to avoid a concurrent modification exception when we remove bubbles from
                // shortcutBubbles.
                final Set<String> shortcutIds = new HashSet<>(shortcutBubbles.keySet());

                // If we can't find one of our bubbles in the shortcut list, that bubble needs
                // to be removed.
                for (String shortcutId : shortcutBubbles.keySet()) {
                for (String shortcutId : shortcutIds) {
                    boolean foundShortcut = false;
                    for (int i = 0; i < shortcuts.size(); i++) {
                        if (shortcuts.get(i).getId().equals(shortcutId)) {