diff options
Diffstat (limited to 'src/com/android/launcher3/IconCache.java')
-rw-r--r-- | src/com/android/launcher3/IconCache.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/com/android/launcher3/IconCache.java b/src/com/android/launcher3/IconCache.java index c5eeba69d..1200b9774 100644 --- a/src/com/android/launcher3/IconCache.java +++ b/src/com/android/launcher3/IconCache.java @@ -94,7 +94,7 @@ public class IconCache { private final HashMap<ComponentKey, CacheEntry> mCache = new HashMap<ComponentKey, CacheEntry>(INITIAL_ICON_CACHE_CAPACITY); private final int mIconDpi; - @Thunk final IconDB mIconDb; + @Thunk IconDB mIconDb; @Thunk final Handler mWorkerHandler; @@ -200,6 +200,17 @@ public class IconCache { } /** + * Empty out the cache. + */ + public synchronized void flush() { + mCache.clear(); + if (mIconDb != null) { + mIconDb.close(); + } + mIconDb = new IconDB(mContext); + } + + /** * Empty out the cache that aren't of the correct grid size */ public synchronized void flushInvalidIcons(DeviceProfile deviceProfile) { |