diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2015-05-06 16:53:21 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2015-05-06 16:54:08 -0700 |
commit | 77919b93b98f5afa1b39546861197d6065847224 (patch) | |
tree | 74cbf761fbecead52a19c6c0a28e0931edabb636 /src/com/android/launcher3/IconCache.java | |
parent | 1d08f70441999c66b76c97e48b4149e1433be3c3 (diff) | |
download | android_packages_apps_Trebuchet-77919b93b98f5afa1b39546861197d6065847224.tar.gz android_packages_apps_Trebuchet-77919b93b98f5afa1b39546861197d6065847224.tar.bz2 android_packages_apps_Trebuchet-77919b93b98f5afa1b39546861197d6065847224.zip |
Updating the icon cache after all apps has been bound.
> Updating the cache DB version to reset existing cache.
Bug: 20834835
Change-Id: I298ca9ddcc4dd270b25b767447ecde01ef41a916
Diffstat (limited to 'src/com/android/launcher3/IconCache.java')
-rw-r--r-- | src/com/android/launcher3/IconCache.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/com/android/launcher3/IconCache.java b/src/com/android/launcher3/IconCache.java index fd4571482..6c2aa397d 100644 --- a/src/com/android/launcher3/IconCache.java +++ b/src/com/android/launcher3/IconCache.java @@ -407,6 +407,20 @@ public class IconCache { } /** + * Updates {@param application} only if a valid entry is found. + */ + public synchronized void updateTitleAndIcon(AppInfo application) { + CacheEntry entry = cacheLocked(application.componentName, null, application.user, + false, application.usingLowResIcon); + if (entry.icon != null && !isDefaultIcon(entry.icon, application.user)) { + application.title = entry.title; + application.iconBitmap = entry.icon; + application.contentDescription = entry.contentDescription; + application.usingLowResIcon = entry.isLowResIcon; + } + } + + /** * Returns a high res icon for the given intent and user */ public synchronized Bitmap getIcon(Intent intent, UserHandleCompat user) { @@ -655,7 +669,7 @@ public class IconCache { } private static final class IconDB extends SQLiteOpenHelper { - private final static int DB_VERSION = 3; + private final static int DB_VERSION = 4; private final static String TABLE_NAME = "icons"; private final static String COLUMN_ROWID = "rowid"; |