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

@@ -35,8 +35,8 @@ import com.android.launcher3.LauncherModel;
import com.android.launcher3.model.BgDataModel.Callbacks;
import com.android.launcher3.model.data.AppInfo;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.model.data.WorkspaceData;
import com.android.launcher3.util.Executors;
import com.android.launcher3.util.IntSparseArrayMap;
import com.android.launcher3.util.LauncherLayoutBuilder;
import com.android.launcher3.util.PackageUserKey;
import com.android.launcher3.util.SandboxApplication;
@@ -176,8 +176,7 @@ public class ModelMultiCallbacksTest {
MyCallbacks() { }
@Override
public void bindCompleteModel(
IntSparseArrayMap<ItemInfo> itemIdMap, boolean isBindingSync) {
public void bindCompleteModel(WorkspaceData itemIdMap, boolean isBindingSync) {
mItems = itemIdMap.stream().toList();
}