Update prediction task to provide categorized suggestions.

Also adds a helper in popup data provider to provide categorized
suggestions. Used in follow up CL to update the UI.

Bug: 318410881
Test: WidgetsPredictionUpdateTaskTest and manual with follow up changes
Flag: ACONFIG com.android.launcher3.enable_categorized_widget_recommendations DEVELOPMENT
Change-Id: Ie80e8ba7bbe874f7c4b0e579446edf571036555e
This commit is contained in:
Shamali P
2024-02-06 18:14:49 +00:00
parent f9eced5768
commit 57c1eedbc6
5 changed files with 105 additions and 25 deletions
@@ -27,6 +27,7 @@ import com.android.launcher3.PendingAddItemInfo;
import com.android.launcher3.logger.LauncherAtom;
import com.android.launcher3.model.data.FolderInfo;
import com.android.launcher3.model.data.LauncherAppWidgetInfo;
import com.android.launcher3.widget.picker.WidgetRecommendationCategory;
import com.android.launcher3.widget.util.WidgetSizes;
/**
@@ -42,6 +43,16 @@ public class PendingAddWidgetInfo extends PendingAddItemInfo {
public Bundle bindOptions = null;
public int sourceContainer;
public WidgetRecommendationCategory recommendationCategory = null;
public PendingAddWidgetInfo(
LauncherAppWidgetProviderInfo i,
int container,
WidgetRecommendationCategory recommendationCategory) {
this(i, container);
this.recommendationCategory = recommendationCategory;
}
public PendingAddWidgetInfo(LauncherAppWidgetProviderInfo i, int container) {
if (i.isCustomWidget()) {
itemType = LauncherSettings.Favorites.ITEM_TYPE_CUSTOM_APPWIDGET;