diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2016-11-09 10:43:58 -0800 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2016-12-13 10:31:12 -0800 |
commit | 1cd01b023acc123b771765b7297d8aaedac224e0 (patch) | |
tree | 9f275f4cbf290c7fb7e67a913bba14079abcd982 /src/com/android/launcher3/IconCache.java | |
parent | 824c540f1911101321ebe7f05cb0885a4922e363 (diff) | |
download | android_packages_apps_Trebuchet-1cd01b023acc123b771765b7297d8aaedac224e0.tar.gz android_packages_apps_Trebuchet-1cd01b023acc123b771765b7297d8aaedac224e0.tar.bz2 android_packages_apps_Trebuchet-1cd01b023acc123b771765b7297d8aaedac224e0.zip |
Ensuring that ShortcutInfo always has an icon
> Making iconBitmap public instead of a getter (similar to AppInfo)
> Removing getIcon() which can lead to IO on UI thread
> Removing updateIcon and handling the update at the caller
Bug: 21325319
Change-Id: I6a49b9043f974e9629ea25e77012d97cc04c0594
Diffstat (limited to 'src/com/android/launcher3/IconCache.java')
-rw-r--r-- | src/com/android/launcher3/IconCache.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/com/android/launcher3/IconCache.java b/src/com/android/launcher3/IconCache.java index 4b09bf82d..9f332a450 100644 --- a/src/com/android/launcher3/IconCache.java +++ b/src/com/android/launcher3/IconCache.java @@ -490,7 +490,7 @@ public class IconCache { // null info means not installed, but if we have a component from the intent then // we should still look in the cache for restored app icons. if (component == null) { - shortcutInfo.setIcon(getDefaultIcon(user)); + shortcutInfo.iconBitmap = getDefaultIcon(user); shortcutInfo.title = ""; shortcutInfo.contentDescription = ""; shortcutInfo.usingLowResIcon = false; @@ -507,7 +507,7 @@ public class IconCache { ShortcutInfo shortcutInfo, ComponentName component, LauncherActivityInfoCompat info, UserHandleCompat user, boolean usePkgIcon, boolean useLowResIcon) { CacheEntry entry = cacheLocked(component, info, user, usePkgIcon, useLowResIcon); - shortcutInfo.setIcon(getNonNullIcon(entry, user)); + shortcutInfo.iconBitmap = getNonNullIcon(entry, user); shortcutInfo.title = Utilities.trim(entry.title); shortcutInfo.contentDescription = entry.contentDescription; shortcutInfo.usingLowResIcon = entry.isLowResIcon; |