From e5467dccdd26ff912afb43d626346e4506c9c062 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Mon, 14 Oct 2013 17:03:04 -0700 Subject: Flushing icons of the wrong size. (Bug 11203738) Change-Id: I9468d2e798fcf9890970270041d341e7653432f1 --- src/com/android/launcher3/IconCache.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/com/android/launcher3/IconCache.java') 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 @@ -146,6 +146,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." */ -- cgit v1.2.3