Merge "Ensuring that each CacheEntry has a default title and content description." into ub-launcher3-burnaby
diff --git a/src/com/android/launcher3/IconCache.java b/src/com/android/launcher3/IconCache.java
index 77d9045..6dfca9e 100644
--- a/src/com/android/launcher3/IconCache.java
+++ b/src/com/android/launcher3/IconCache.java
@@ -73,8 +73,8 @@
@Thunk static class CacheEntry {
public Bitmap icon;
- public CharSequence title;
- public CharSequence contentDescription;
+ public CharSequence title = "";
+ public CharSequence contentDescription = "";
public boolean isLowResIcon;
}
@@ -575,7 +575,7 @@
CacheEntry entry = mCache.get(cacheKey);
if (entry == null || (entry.isLowResIcon && !useLowResIcon)) {
entry = new CacheEntry();
- mCache.put(cacheKey, entry);
+ boolean entryUpdated = true;
// Check the DB first.
if (!getEntryFromDB(cn, user, entry, useLowResIcon)) {
@@ -600,8 +600,14 @@
} catch (NameNotFoundException e) {
if (DEBUG) Log.d(TAG, "Application not installed " + packageName);
+ entryUpdated = false;
}
}
+
+ // Only add a filled-out entry to the cache
+ if (entryUpdated) {
+ mCache.put(cacheKey, entry);
+ }
}
return entry;
}