Making LauncherIcons thread safe

Creating a pool of LauncherIcons so that they can be used from multiple threads

Change-Id: Idc7b5ddb47b6e338a5389f3c4faa6f63de108c72
This commit is contained in:
Sunny Goyal committed 2018-01-09 17:30:52 -08:00
1 parent 383b7fa02a
commit 18a4e5aefb
21 files changed
+276 -391

No files matched your search

@@ -95,8 +95,10 @@ public class ShortcutsChangedTask extends BaseModelUpdateTask {
shortcutInfo.updateFromDeepShortcutInfo(fullDetails, context);
// If the shortcut is pinned but no longer has an icon in the system,
// keep the current icon instead of reverting to the default icon.
LauncherIcons.createShortcutIcon(fullDetails, context, true,
Provider.of(shortcutInfo.iconBitmap)).applyTo(shortcutInfo);
LauncherIcons li = LauncherIcons.obtain(context);
li.createShortcutIcon(fullDetails, true, Provider.of(shortcutInfo.iconBitmap))
.applyTo(shortcutInfo);
li.recycle();
updatedShortcutInfos.add(shortcutInfo);
}
}