Updating the icon cache after all apps has been bound.
> Updating the cache DB version to reset existing cache.
Bug: 20834835
Change-Id: I298ca9ddcc4dd270b25b767447ecde01ef41a916
diff --git a/src/com/android/launcher3/IconCache.java b/src/com/android/launcher3/IconCache.java
index fd45714..6c2aa39 100644
--- a/src/com/android/launcher3/IconCache.java
+++ b/src/com/android/launcher3/IconCache.java
@@ -407,6 +407,20 @@
}
/**
+ * 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 @@
}
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";