Making workspaceData immutable

BgDataModel holds a mutable handle of the data, which ensures that all edits go through this class and there is a single place to keep the repository updated

Bug: 390572144
Test: Updated existing model tests
Flag: EXEMPT refactor
Change-Id: I991b707dd21801d1abd00510f676549947285012
This commit is contained in:
Sunny Goyal committed 2025-05-07 13:21:21 -07:00
1 parent 51343f74d5
commit 57a195b790
30 files changed
+382 -377

No files matched your search

@@ -32,9 +32,9 @@ import com.android.launcher3.model.BgDataModel;
import com.android.launcher3.model.data.AppInfo;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.model.data.PredictedContainerInfo;
import com.android.launcher3.model.data.WorkspaceData;
import com.android.launcher3.taskbar.TaskbarView.TaskbarLayoutParams;
import com.android.launcher3.util.ComponentKey;
import com.android.launcher3.util.IntSparseArrayMap;
import com.android.launcher3.util.ItemInfoMatcher;
import com.android.launcher3.util.LauncherBindableItemsContainer;
import com.android.launcher3.util.PackageUserKey;
@@ -79,10 +79,9 @@ public class TaskbarModelCallbacks implements
}
@Override
public void bindCompleteModel(IntSparseArrayMap<ItemInfo> itemIdMap, boolean isBindingSync) {
public void bindCompleteModel(WorkspaceData itemIdMap, boolean isBindingSync) {
mHotseatItems.clear();
mPredictedItems = itemIdMap.get(CONTAINER_HOTSEAT_PREDICTION)
instanceof PredictedContainerInfo pci ? pci.getContents() : Collections.emptyList();
mPredictedItems = itemIdMap.getPredictedContents(CONTAINER_HOTSEAT_PREDICTION);
handleItemsAdded(itemIdMap);
if (itemIdMap.get(CONTAINER_ALL_APPS_PREDICTION) instanceof PredictedContainerInfo pci) {