Moving predicted items to ItemIdMap instead of extraItems

> This allows the whole workspace model to be contained in itemIdMap instead of spread across multiple data containers
> Deprecating extraItems, all non-workspace data should use separate repositories
> Design: http://go/launchermodel-re-arch?#heading=h.5y8n4r164d5s

Bug: 390572144
Test: atest PredictionUpdateTaskTest
Flag: EXEMPT refactor
Change-Id: I886d0a8d5bbbf9f5c2054d4a2442bf03f9c4eab5
This commit is contained in:
Sunny Goyal committed 2025-05-05 15:52:37 -07:00
1 parent cf29edfa2f
commit aef6c7932e
31 files changed
+419 -228

No files matched your search

@@ -16,6 +16,7 @@
package com.android.launcher3.model;
import static com.android.launcher3.util.LauncherModelHelper.TEST_PACKAGE;
import static com.android.launcher3.util.ModelTestExtensions.nonPredictedItemCount;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
@@ -32,7 +33,6 @@ import androidx.test.filters.SmallTest;
import com.android.launcher3.LauncherAppState;
import com.android.launcher3.LauncherModel;
import com.android.launcher3.model.BgDataModel.Callbacks;
import com.android.launcher3.model.BgDataModel.FixedContainerItems;
import com.android.launcher3.model.data.AppInfo;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.util.Executors;
@@ -176,9 +176,8 @@ public class ModelMultiCallbacksTest {
MyCallbacks() { }
@Override
public void bindCompleteModel(IntSparseArrayMap<ItemInfo> itemIdMap,
List<FixedContainerItems> extraItems, StringCache stringCache,
boolean isBindingSync) {
public void bindCompleteModel(
IntSparseArrayMap<ItemInfo> itemIdMap, boolean isBindingSync) {
mItems = itemIdMap.stream().toList();
}
@@ -195,7 +194,7 @@ public class ModelMultiCallbacksTest {
public void verifyItemsBound(int totalItems) {
assertNotNull(mItems);
assertEquals(mItems.size(), totalItems);
assertEquals(totalItems, nonPredictedItemCount(mItems));
}
public Set<String> allApps() {