summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2013-10-14 17:03:04 -0700
committerWinson Chung <winsonc@google.com>2013-10-14 17:03:04 -0700
commite5467dccdd26ff912afb43d626346e4506c9c062 (patch)
tree933abd1fb3ad89241169643dd4bd736263d2668f /src
parent2456b9738803b5f4314b6747dd7eea116d03eb3d (diff)
downloadandroid_packages_apps_Trebuchet-e5467dccdd26ff912afb43d626346e4506c9c062.tar.gz
android_packages_apps_Trebuchet-e5467dccdd26ff912afb43d626346e4506c9c062.tar.bz2
android_packages_apps_Trebuchet-e5467dccdd26ff912afb43d626346e4506c9c062.zip
Flushing icons of the wrong size. (Bug 11203738)
Change-Id: I9468d2e798fcf9890970270041d341e7653432f1
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher3/IconCache.java14
-rw-r--r--src/com/android/launcher3/Launcher.java1
2 files changed, 15 insertions, 0 deletions
diff --git a/src/com/android/launcher3/IconCache.java b/src/com/android/launcher3/IconCache.java
index 179782653..2aab68bee 100644
--- a/src/com/android/launcher3/IconCache.java
+++ b/src/com/android/launcher3/IconCache.java
@@ -147,6 +147,20 @@ public class IconCache {
}
/**
+ * Empty out the cache that aren't of the correct grid size
+ */
+ public void flushInvalidIcons(DeviceProfile grid) {
+ synchronized (mCache) {
+ for (ComponentName cn : mCache.keySet()) {
+ final CacheEntry e = mCache.get(cn);
+ if (e.icon.getWidth() != grid.iconSizePx || e.icon.getHeight() != grid.iconSizePx) {
+ mCache.remove(cn);
+ }
+ }
+ }
+ }
+
+ /**
* Fill in "application" with the icon and label for "info."
*/
public void getTitleAndIcon(AppInfo application, ResolveInfo info,
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index ee13f2946..b0e49685d 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -402,6 +402,7 @@ public class Launcher extends Activity
Context.MODE_PRIVATE);
mModel = app.setLauncher(this);
mIconCache = app.getIconCache();
+ mIconCache.flushInvalidIcons(grid);
mDragController = new DragController(this);
mInflater = getLayoutInflater();