Filter shortcuts in the widget picker activity.

In its current state the WidgetPickerActivity only allows adding widget
items, so to match the state, updated it to show only widgets.

manual test - https://screen/cast/NDUxMjg1NjI0MTM0MDQxNnwxMzE4MzNhOS1mZg

Bug: 320495335
Test: atest Launcher3Tests
Flag: N/A
Change-Id: Ifa75f457219efef49e104efc428d369187db2710
This commit is contained in:
Shamali P
2024-01-16 19:22:39 +00:00
parent 4743cb3b87
commit ddde81f4c0
3 changed files with 49 additions and 14 deletions

View File

@@ -158,7 +158,10 @@ public class WidgetPickerActivity extends BaseActivity {
LauncherAppState app = LauncherAppState.getInstance(this);
mModel.update(app, null);
final ArrayList<WidgetsListBaseEntry> widgets =
mModel.getWidgetsListForPicker(app.getContext());
mModel.getFilteredWidgetsListForPicker(
app.getContext(),
/*widgetItemFilter=*/ item -> item.widgetInfo != null
);
MAIN_EXECUTOR.execute(() -> mPopupDataProvider.setAllWidgets(widgets));
});
}