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

Commit 7dbccc66 authored by Kshitij's avatar Kshitij
Browse files

fix: Ensure widget list is mutable

- WidgetFullSheet may try to remove "ghost" widgets
- It assumes the list is mutable and calls removeIf. To prevent a crash
  initialize with ArrayList instead of List.of()
parent 959bdcfe
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ import com.android.launcher3.widget.model.WidgetsListContentEntry;
import com.android.launcher3.widget.picker.WidgetRecommendationCategory;

import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
@@ -63,9 +64,9 @@ public class PopupDataProvider implements NotificationListener.NotificationsChan
    private Map<PackageUserKey, DotInfo> mPackageUserToDotInfos = new HashMap<>();

    /** All installed widgets. */
    private List<WidgetsListBaseEntry> mAllWidgets = List.of();
    private List<WidgetsListBaseEntry> mAllWidgets = new ArrayList<>();
    /** Widgets that can be recommended to the users. */
    private List<ItemInfo> mRecommendedWidgets = List.of();
    private List<ItemInfo> mRecommendedWidgets = new ArrayList<>();

    private PopupDataChangeListener mChangeListener = PopupDataChangeListener.INSTANCE;