Moving LoaderTask static

Will move it to a separate file in a followup cl.
This simplifies dependencies between LauncherModel and LoaderTask which
and making it easier to start the loader before Launcher activity is
created (as the Callbacks in LauncherModel can change while loader is running).

Bug: 34112546
Bug: 37616877
Change-Id: Ie9619c6b0de0e3eb60657c04ae1b58d946c829e9
This commit is contained in:
Sunny Goyal
2017-06-02 13:46:55 -07:00
parent ccb25a3da8
commit c6e97692e4
10 changed files with 215 additions and 189 deletions

View File

@@ -59,4 +59,15 @@ public abstract class ExtendedModelTask extends BaseModelUpdateTask {
}
});
}
public void bindUpdatedWidgets(BgDataModel dataModel) {
final MultiHashMap<PackageItemInfo, WidgetItem> widgets
= dataModel.widgetsModel.getWidgetsMap();
scheduleCallbackTask(new CallbackTask() {
@Override
public void execute(Callbacks callbacks) {
callbacks.bindAllWidgets(widgets);
}
});
}
}