Revert "Unifying various model update callbacks into one"

Revert submission 31445615-model-callbacks

Reason for revert: <Droidmonitor crested revert due to b/393222548. Will be verified through ABTD for stanadard investigation.>

Reverted changes: /q/submissionid:31445615-model-callbacks

Change-Id: If6893a125756e5abfbb215af377576429bb1c91b
This commit is contained in:
Pechetty Sravani (xWF) authored and Android (Google) Code Review committed 2025-01-29 22:46:55 -08:00
1 parent 36c3112abf
commit 72f9943f64
19 files changed
+369 -441

No files matched your search

@@ -214,7 +214,8 @@ public class PackageUpdatedTask implements ModelUpdateTask {
// Update shortcut infos
if (mOp == OP_ADD || flagOp != FlagOp.NO_OP) {
final ArrayList<ItemInfo> updatedWorkspaceItems = new ArrayList<>();
final ArrayList<WorkspaceItemInfo> updatedWorkspaceItems = new ArrayList<>();
final ArrayList<LauncherAppWidgetInfo> widgets = new ArrayList<>();
// For system apps, package manager send OP_UPDATE when an app is enabled.
final boolean isNewApkAvailable = mOp == OP_ADD || mOp == OP_UPDATE;
@@ -363,8 +364,8 @@ public class PackageUpdatedTask implements ModelUpdateTask {
// if the widget has a config activity. In case there is no config
// activity, it will be marked as 'restored' during bind.
widgetInfo.restoreStatus |= LauncherAppWidgetInfo.FLAG_UI_NOT_READY;
widgetInfo.installProgress = 100;
updatedWorkspaceItems.add(widgetInfo);
widgets.add(widgetInfo);
taskController.getModelWriter().updateItemInDatabase(widgetInfo);
});
}
@@ -376,6 +377,10 @@ public class PackageUpdatedTask implements ModelUpdateTask {
"removing shortcuts with invalid target components."
+ " ids=" + removedShortcuts);
}
if (!widgets.isEmpty()) {
taskController.scheduleCallbackTask(c -> c.bindWidgetsRestored(widgets));
}
}
final HashSet<String> removedPackages = new HashSet<>();