summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2014-09-15 08:48:12 -0700
committerSunny Goyal <sunnygoyal@google.com>2014-09-15 08:51:08 -0700
commit876d11e31a0e146f29775063ce1f36a1b075fb93 (patch)
tree8af917af9c51ddd53fc0cd8aecce02c5334d6a77
parenta20490cd9ee80d0dc8eb035d50853b48592cac5b (diff)
downloadandroid_packages_apps_Trebuchet-876d11e31a0e146f29775063ce1f36a1b075fb93.tar.gz
android_packages_apps_Trebuchet-876d11e31a0e146f29775063ce1f36a1b075fb93.tar.bz2
android_packages_apps_Trebuchet-876d11e31a0e146f29775063ce1f36a1b075fb93.zip
Null check in flushInvalidIcons
> Icons in a CacheEntry can be null, for a restored app. No need to flush such entries on DeviceProfileChange Bug: 17489687 Change-Id: If6e76206ae5bd8201c9928257706224f2f34c232
-rw-r--r--src/com/android/launcher3/IconCache.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/com/android/launcher3/IconCache.java b/src/com/android/launcher3/IconCache.java
index ddc1bd949..8a3c3193b 100644
--- a/src/com/android/launcher3/IconCache.java
+++ b/src/com/android/launcher3/IconCache.java
@@ -229,7 +229,8 @@ public class IconCache {
Iterator<Entry<CacheKey, CacheEntry>> it = mCache.entrySet().iterator();
while (it.hasNext()) {
final CacheEntry e = it.next().getValue();
- if (e.icon.getWidth() < grid.iconSizePx || e.icon.getHeight() < grid.iconSizePx) {
+ if ((e.icon != null) && (e.icon.getWidth() < grid.iconSizePx
+ || e.icon.getHeight() < grid.iconSizePx)) {
it.remove();
}
}