Cleanup widgetsModel and add tests

1. Removes unused method `getAllWidgetComponentsWithoutShortcuts`
2. Exposes widgets either as component map or package item map - to
eliminate the duplicate logic around widget sections.
3. Add tests that validate that each package is unique - to help
cover the redirect issue seen in past.
4. In follow up cls, other methods that deal with picker specific data
types like WidgetsListBaseEntry will also be moved out - leaving the
model to only be responsible for providing all widgets map or widgets
by package.

Bug: 341611976
Flag: EXEMPT BUGFIX
Test: Unit test
Change-Id: Ife70874d312b51c66025a6ec678480f2b5c41793
This commit is contained in:
Shamali P committed 2024-07-17 14:29:31 +00:00
1 parent 72c4ebed6c
commit 3ae39c72de
4 files changed
+250 -103

No files matched your search

@@ -65,7 +65,7 @@ public final class WidgetsPredictionUpdateTask implements ModelUpdateTask {
Collectors.toSet());
Predicate<WidgetItem> notOnWorkspace = w -> !widgetsInWorkspace.contains(w);
Map<ComponentKey, WidgetItem> allWidgets =
dataModel.widgetsModel.getAllWidgetComponentsWithoutShortcuts();
dataModel.widgetsModel.getWidgetsByComponentKey();
List<WidgetItem> servicePredictedItems = new ArrayList<>();