diff options
author | Joe Onorato <joeo@android.com> | 2010-08-30 18:30:15 -0700 |
---|---|---|
committer | Joe Onorato <joeo@android.com> | 2010-08-31 12:02:24 -0700 |
commit | f5ed4f1141ae41e25e249f6e085c7080f11dc968 (patch) | |
tree | 2d34b55fac67e1a47ff3b15b7f03a41819af570d /src | |
parent | 2d86dfec5797bfd4fba78562032c14bd9b6cfa7a (diff) | |
download | android_packages_apps_Trebuchet-f5ed4f1141ae41e25e249f6e085c7080f11dc968.tar.gz android_packages_apps_Trebuchet-f5ed4f1141ae41e25e249f6e085c7080f11dc968.tar.bz2 android_packages_apps_Trebuchet-f5ed4f1141ae41e25e249f6e085c7080f11dc968.zip |
DO NOT MERGE - Fix 2941495: Launcher short-cut icons don't work for apps on SD card after reboot
Bug: 2941495
Change-Id: Idf1869d33cd5c01abea5b059ca466529cee0ad93
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/launcher2/IconCache.java | 4 | ||||
-rw-r--r-- | src/com/android/launcher2/LauncherModel.java | 2 | ||||
-rw-r--r-- | src/com/android/launcher2/ShortcutInfo.java | 8 |
3 files changed, 7 insertions, 7 deletions
diff --git a/src/com/android/launcher2/IconCache.java b/src/com/android/launcher2/IconCache.java index 4bb7d08c0..81a786ca7 100644 --- a/src/com/android/launcher2/IconCache.java +++ b/src/com/android/launcher2/IconCache.java @@ -124,6 +124,10 @@ public class IconCache { } } + public boolean isDefaultIcon(Bitmap icon) { + return mDefaultIcon == icon; + } + private CacheEntry cacheLocked(ComponentName componentName, ResolveInfo info) { CacheEntry entry = mCache.get(componentName); if (entry == null) { diff --git a/src/com/android/launcher2/LauncherModel.java b/src/com/android/launcher2/LauncherModel.java index eb341f68a..c1ecf506e 100644 --- a/src/com/android/launcher2/LauncherModel.java +++ b/src/com/android/launcher2/LauncherModel.java @@ -1490,7 +1490,7 @@ public class LauncherModel extends BroadcastReceiver { // into the DB. We do this so when we're loading, if the // package manager can't find an icon (for example because // the app is on SD) then we can use that instead. - if (info.onExternalStorage && !info.customIcon && !info.usingFallbackIcon) { + if (!info.customIcon && !info.usingFallbackIcon) { boolean needSave; byte[] data = c.getBlob(iconIndex); try { diff --git a/src/com/android/launcher2/ShortcutInfo.java b/src/com/android/launcher2/ShortcutInfo.java index 5c322baaa..2c5aec436 100644 --- a/src/com/android/launcher2/ShortcutInfo.java +++ b/src/com/android/launcher2/ShortcutInfo.java @@ -54,11 +54,6 @@ class ShortcutInfo extends ItemInfo { boolean usingFallbackIcon; /** - * Indicates whether the shortcut is on external storage and may go away at any time. - */ - boolean onExternalStorage; - - /** * If isShortcut=true and customIcon=false, this contains a reference to the * shortcut icon as an application's resource. */ @@ -101,6 +96,7 @@ class ShortcutInfo extends ItemInfo { public Bitmap getIcon(IconCache iconCache) { if (mIcon == null) { mIcon = iconCache.getIcon(this.intent); + this.usingFallbackIcon = iconCache.isDefaultIcon(mIcon); } return mIcon; } @@ -135,7 +131,7 @@ class ShortcutInfo extends ItemInfo { LauncherSettings.BaseLauncherColumns.ICON_TYPE_BITMAP); writeBitmap(values, mIcon); } else { - if (onExternalStorage && !usingFallbackIcon) { + if (!usingFallbackIcon) { writeBitmap(values, mIcon); } values.put(LauncherSettings.BaseLauncherColumns.ICON_TYPE, |