Unifying various model update callbacks into one
Making the BubbleTextView.applyItem stateless so that it does not depend on the order of events
Bug: 390572144
Flag: EXEMPT refactor
Test: atest LauncherBindableItemsContainerTest
atest BubbleTextViewTest
Change-Id: Ib9c0ac6c330d6f4e08c3db5772d35787fa056b65
This commit is contained in:
1 parent
1809cb6ff3
commit
36c3112abf
19 files changed
+442
-370
No files matched your search
@@ -214,8 +214,7 @@ public class PackageUpdatedTask implements ModelUpdateTask {
|
||||
|
||||
// Update shortcut infos
|
||||
if (mOp == OP_ADD || flagOp != FlagOp.NO_OP) {
|
||||
final ArrayList<WorkspaceItemInfo> updatedWorkspaceItems = new ArrayList<>();
|
||||
final ArrayList<LauncherAppWidgetInfo> widgets = new ArrayList<>();
|
||||
final ArrayList<ItemInfo> updatedWorkspaceItems = new ArrayList<>();
|
||||
|
||||
// For system apps, package manager send OP_UPDATE when an app is enabled.
|
||||
final boolean isNewApkAvailable = mOp == OP_ADD || mOp == OP_UPDATE;
|
||||
@@ -364,8 +363,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;
|
||||
|
||||
widgets.add(widgetInfo);
|
||||
widgetInfo.installProgress = 100;
|
||||
updatedWorkspaceItems.add(widgetInfo);
|
||||
taskController.getModelWriter().updateItemInDatabase(widgetInfo);
|
||||
});
|
||||
}
|
||||
@@ -377,10 +376,6 @@ 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<>();
|
||||
|
||||
Reference in new issue
Block a user