summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/model/ShortcutsChangedTask.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2018-01-09 15:34:38 -0800
committerSunny Goyal <sunnygoyal@google.com>2018-01-09 17:30:52 -0800
commit18a4e5aefbd1bd562e9161f8f10b5d3825e7b69d (patch)
tree2d0ea9e26a4e1325bf438f57b01558ad3fe0a4c6 /src/com/android/launcher3/model/ShortcutsChangedTask.java
parent383b7fa02a215fbe979e0eebde1d146f1a30e935 (diff)
downloadandroid_packages_apps_Trebuchet-18a4e5aefbd1bd562e9161f8f10b5d3825e7b69d.tar.gz
android_packages_apps_Trebuchet-18a4e5aefbd1bd562e9161f8f10b5d3825e7b69d.tar.bz2
android_packages_apps_Trebuchet-18a4e5aefbd1bd562e9161f8f10b5d3825e7b69d.zip
Making LauncherIcons thread safe
Creating a pool of LauncherIcons so that they can be used from multiple threads Change-Id: Idc7b5ddb47b6e338a5389f3c4faa6f63de108c72
Diffstat (limited to 'src/com/android/launcher3/model/ShortcutsChangedTask.java')
-rw-r--r--src/com/android/launcher3/model/ShortcutsChangedTask.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/com/android/launcher3/model/ShortcutsChangedTask.java b/src/com/android/launcher3/model/ShortcutsChangedTask.java
index 0b75e2c88..59f3d1c60 100644
--- a/src/com/android/launcher3/model/ShortcutsChangedTask.java
+++ b/src/com/android/launcher3/model/ShortcutsChangedTask.java
@@ -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);
}
}