mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-28 15:56:49 +00:00
DO NOT MERGE - Fix 2941495: Launcher short-cut icons don't work for apps on SD card after reboot
Bug: 2941495 Change-Id: Idf1869d33cd5c01abea5b059ca466529cee0ad93
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -53,11 +53,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,
|
||||
|
||||
Reference in New Issue
Block a user