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:
1 parent
cf29edfa2f
commit
aef6c7932e
31 files changed
+419
-228
No files matched your search
@@ -30,7 +30,6 @@ import com.android.launcher3.model.data.LauncherAppWidgetInfo;
|
||||
import com.android.launcher3.pm.PackageInstallInfo;
|
||||
import com.android.launcher3.util.InstantAppResolver;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -78,13 +77,14 @@ public class PackageInstallStateChangedTask implements ModelUpdateTask {
|
||||
}
|
||||
|
||||
synchronized (dataModel) {
|
||||
final HashSet<ItemInfo> updates = new HashSet<>();
|
||||
dataModel.forAllWorkspaceItemInfos(mInstallInfo.user, si -> {
|
||||
if (si.hasPromiseIconUi()
|
||||
&& mInstallInfo.packageName.equals(si.getTargetPackage())) {
|
||||
si.setProgressLevel(mInstallInfo);
|
||||
updates.add(si);
|
||||
}
|
||||
final List<ItemInfo> updates = dataModel.updateAndCollectWorkspaceItemInfos(
|
||||
mInstallInfo.user, si -> {
|
||||
if (si.hasPromiseIconUi()
|
||||
&& mInstallInfo.packageName.equals(si.getTargetPackage())) {
|
||||
si.setProgressLevel(mInstallInfo);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
dataModel.itemsIdMap.stream()
|
||||
|
||||
Reference in new issue
Block a user