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

Commit 8f85ad38 authored by Sihua Ma's avatar Sihua Ma Committed by Android (Google) Code Review
Browse files

Merge "Fix ConcurrentModificationException in QuickstepWidgetHolder" into udc-dev

parents db07d222 d72ce237
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -95,7 +95,11 @@ public final class QuickstepWidgetHolder extends LauncherWidgetHolder {
                    i -> MAIN_EXECUTOR.execute(() ->
                            sHolders.forEach(h -> h.mAppWidgetRemovedCallback.accept(i))),
                    () -> MAIN_EXECUTOR.execute(() ->
                            sHolders.forEach(h -> h.mProviderChangedListeners.forEach(
                            sHolders.forEach(h ->
                                    // Listeners might remove themselves from the list during the
                                    // iteration. Creating a copy of the list to avoid exceptions
                                    // for concurrent modification.
                                    new ArrayList<>(h.mProviderChangedListeners).forEach(
                                    ProviderChangedListener::notifyWidgetProvidersChanged))),
                    UI_HELPER_EXECUTOR.getLooper());
            if (!WidgetsModel.GO_DISABLE_WIDGETS) {