Moving ShortcutInfo creation in InstallShortcutReceiver to background thread

> Creating shortcut info requires iconCache access

Bug: 21325319
Change-Id: I3317d8b6824aa05b836f3ed3626f169d4d34f783
This commit is contained in:
Sunny Goyal committed 2016-11-30 05:47:57 +05:30
1 parent 6f59cff0d6
commit 2bcbe13c64
6 files changed
+111 -52

No files matched your search

+10 -2
View File
@@ -84,6 +84,7 @@ import com.android.launcher3.util.ManagedProfileHeuristic;
import com.android.launcher3.util.MultiHashMap;
import com.android.launcher3.util.PackageManagerHelper;
import com.android.launcher3.util.Preconditions;
import com.android.launcher3.util.Provider;
import com.android.launcher3.util.Thunk;
import com.android.launcher3.util.ViewOnDrawExecutor;
@@ -258,12 +259,19 @@ public class LauncherModel extends BroadcastReceiver
CacheDataUpdatedTask.OP_SESSION_UPDATE, UserHandleCompat.myUserHandle(), packages));
}
/**
* Adds the provided items to the workspace.
*/
public void addAndBindAddedWorkspaceItems(List<ItemInfo> workspaceApps) {
addAndBindAddedWorkspaceItems(Provider.of(workspaceApps));
}
/**
* Adds the provided items to the workspace.
*/
public void addAndBindAddedWorkspaceItems(
final ArrayList<? extends ItemInfo> workspaceApps) {
enqueueModelUpdateTask(new AddWorkspaceItemsTask(workspaceApps));
Provider<List<ItemInfo>> appsProvider) {
enqueueModelUpdateTask(new AddWorkspaceItemsTask(appsProvider));
}
/**