Making LauncherIcons thread safe
Creating a pool of LauncherIcons so that they can be used from multiple threads
Change-Id: Idc7b5ddb47b6e338a5389f3c4faa6f63de108c72
diff --git a/src/com/android/launcher3/AutoInstallsLayout.java b/src/com/android/launcher3/AutoInstallsLayout.java
index 9775955..469b8bb 100644
--- a/src/com/android/launcher3/AutoInstallsLayout.java
+++ b/src/com/android/launcher3/AutoInstallsLayout.java
@@ -437,9 +437,11 @@
}
// Auto installs should always support the current platform version.
+ LauncherIcons li = LauncherIcons.obtain(mContext);
mValues.put(LauncherSettings.Favorites.ICON, Utilities.flattenBitmap(
- LauncherIcons.createBadgedIconBitmap(
- icon, Process.myUserHandle(), mContext, VERSION.SDK_INT).icon));
+ li.createBadgedIconBitmap(icon, Process.myUserHandle(), VERSION.SDK_INT).icon));
+ li.recycle();
+
mValues.put(Favorites.ICON_PACKAGE, mIconRes.getResourcePackageName(iconId));
mValues.put(Favorites.ICON_RESOURCE, mIconRes.getResourceName(iconId));