diff options
author | Chris Wren <cwren@android.com> | 2014-02-10 12:16:54 -0500 |
---|---|---|
committer | Chris Wren <cwren@android.com> | 2014-02-14 11:49:30 -0500 |
commit | 6d0dde01f307051ee1849481c989d9e87774b894 (patch) | |
tree | 76a3c70f422e8a4e86352885d8239e67b17c8453 /src/com/android/launcher3/LauncherModel.java | |
parent | 55bd9725d5c0373b89f7b9bbd9547550ea3bbc63 (diff) | |
download | android_packages_apps_Trebuchet-6d0dde01f307051ee1849481c989d9e87774b894.tar.gz android_packages_apps_Trebuchet-6d0dde01f307051ee1849481c989d9e87774b894.tar.bz2 android_packages_apps_Trebuchet-6d0dde01f307051ee1849481c989d9e87774b894.zip |
use restored icon for restored app shortcuts
Bug: 10778992
Change-Id: Ie430a6587d49dc0d78b87b81582c0cef7c281017
Diffstat (limited to 'src/com/android/launcher3/LauncherModel.java')
-rw-r--r-- | src/com/android/launcher3/LauncherModel.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java index f4fa10ffa..007fd7a4a 100644 --- a/src/com/android/launcher3/LauncherModel.java +++ b/src/com/android/launcher3/LauncherModel.java @@ -318,10 +318,16 @@ public class LauncherModel extends BroadcastReceiver { public void run() { Callbacks cb = mCallbacks != null ? mCallbacks.get() : null; if (callbacks == cb && cb != null) { - callbacks.bindAppsAdded(null, null, null, allAppsApps); if (!restoredAppsFinal.isEmpty()) { + for (AppInfo info : restoredAppsFinal) { + final Intent intent = info.getIntent(); + if (intent != null) { + mIconCache.deletePreloadedIcon(intent.getComponent()); + } + } callbacks.bindAppsUpdated(restoredAppsFinal); } + callbacks.bindAppsAdded(null, null, null, allAppsApps); } } }); @@ -2667,6 +2673,7 @@ public class LauncherModel extends BroadcastReceiver { case OP_ADD: for (int i=0; i<N; i++) { if (DEBUG_LOADERS) Log.d(TAG, "mAllAppsList.addPackage " + packages[i]); + mIconCache.remove(packages[i]); mBgAllAppsList.addPackage(context, packages[i]); } break; @@ -2862,13 +2869,12 @@ public class LauncherModel extends BroadcastReceiver { */ public ShortcutInfo getRestoredItemInfo(Cursor cursor, int titleIndex, Intent intent) { final ShortcutInfo info = new ShortcutInfo(); - info.usingFallbackIcon = true; - info.setIcon(getFallbackIcon()); if (cursor != null) { info.title = cursor.getString(titleIndex); } else { info.title = ""; } + info.setIcon(mIconCache.getIcon(intent, info.title.toString())); info.itemType = LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT; info.restoredIntent = intent; return info; |