Moving icon generation out of ShortcutInfo constructor so that it

can be created on the UI thread

Change-Id: If84e52041eb4ab20807f5cfd4b7f31d7b5f381ed
This commit is contained in:
Sunny Goyal
2017-01-18 11:30:23 -08:00
parent a3db1fc674
commit 1b0726359b
8 changed files with 92 additions and 85 deletions

View File

@@ -24,6 +24,7 @@ import com.android.launcher3.LauncherAppState;
import com.android.launcher3.LauncherModel;
import com.android.launcher3.LauncherSettings;
import com.android.launcher3.ShortcutInfo;
import com.android.launcher3.graphics.LauncherIcons;
import com.android.launcher3.shortcuts.DeepShortcutManager;
import com.android.launcher3.shortcuts.ShortcutInfoCompat;
import com.android.launcher3.util.MultiHashMap;
@@ -87,6 +88,8 @@ public class ShortcutsChangedTask extends ExtendedModelTask {
}
for (ShortcutInfo shortcutInfo : shortcutInfos) {
shortcutInfo.updateFromDeepShortcutInfo(fullDetails, context);
shortcutInfo.iconBitmap =
LauncherIcons.createShortcutIcon(fullDetails, context);
updatedShortcutInfos.add(shortcutInfo);
}
}