diff options
author | Winson Chung <winsonc@google.com> | 2015-05-28 22:48:50 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-05-28 22:48:50 +0000 |
commit | 0b06875971fffd232ce2dea78cd29145edc5bab4 (patch) | |
tree | 6a4de0f2bc2d438ced0b999c883875145fd72d7c /src/com/android/launcher3/IconCache.java | |
parent | 04a9bc4a50dd0d7438d4c3f980c82db5305c2d76 (diff) | |
parent | cdefc631f8b4b3e56ea3bd238d46d0bc9e28eabe (diff) | |
download | android_packages_apps_Trebuchet-0b06875971fffd232ce2dea78cd29145edc5bab4.tar.gz android_packages_apps_Trebuchet-0b06875971fffd232ce2dea78cd29145edc5bab4.tar.bz2 android_packages_apps_Trebuchet-0b06875971fffd232ce2dea78cd29145edc5bab4.zip |
Merge "Ensuring that each CacheEntry has a default title and content description." into ub-launcher3-burnaby
Diffstat (limited to 'src/com/android/launcher3/IconCache.java')
-rw-r--r-- | src/com/android/launcher3/IconCache.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/com/android/launcher3/IconCache.java b/src/com/android/launcher3/IconCache.java index 77d90456e..6dfca9ef3 100644 --- a/src/com/android/launcher3/IconCache.java +++ b/src/com/android/launcher3/IconCache.java @@ -73,8 +73,8 @@ public class IconCache { @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 @@ public class IconCache { 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 @@ public class IconCache { } 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; } |