Various icon cache fixes
> Multiple instances of LauncherIcon created when
LauncherIcons refers IconCache which in turn creates new LauncherIcons
> Widget icons are never cached as they were using low res icons
> Shortcut drag icons are not loaded synchronously
when using PinItemRequest flow
> Wrong lastUpdatedTime is used in iconCache for shortcuts
> IconUpdateHandler does not ignore managedUser promise icons
Change-Id: Ie7eed68a30fad11d1861b6c70c380953a15ae1cf
diff --git a/src/com/android/launcher3/Utilities.java b/src/com/android/launcher3/Utilities.java
index 7f443b6..e0e4cc0 100644
--- a/src/com/android/launcher3/Utilities.java
+++ b/src/com/android/launcher3/Utilities.java
@@ -584,9 +584,8 @@
return new FixedSizeEmptyDrawable(iconSize);
}
ShortcutInfo si = (ShortcutInfo) obj;
- LauncherIcons li = LauncherIcons.obtain(appState.getContext());
- Bitmap badge = li.getShortcutInfoBadge(si, appState.getIconCache()).bitmap.icon;
- li.recycle();
+ Bitmap badge = LauncherAppState.getInstance(appState.getContext())
+ .getIconCache().getShortcutInfoBadge(si).icon;
float badgeSize = LauncherIcons.getBadgeSizeForIconSize(iconSize);
float insetFraction = (iconSize - badgeSize) / iconSize;
return new InsetDrawable(new FastBitmapDrawable(badge),