diff options
Diffstat (limited to 'src/com/android/launcher3/IconCache.java')
-rw-r--r-- | src/com/android/launcher3/IconCache.java | 14 |
1 files changed, 14 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, |