diff options
author | Yvonne Wong <ywong@cyngn.com> | 2015-11-30 15:32:16 -0800 |
---|---|---|
committer | Yvonne Wong <ywong@cyngn.com> | 2015-11-30 15:32:16 -0800 |
commit | fe70926e116fca0d84b3642aae3fe6c68d6c7264 (patch) | |
tree | ff7d77fd2fa683807b85f580a45f231d6f6c2433 /src/com/android/launcher3/IconCache.java | |
parent | b3de38c976eeb5a8c4b5c1b0d68d9c84253d3187 (diff) | |
download | android_packages_apps_Trebuchet-fe70926e116fca0d84b3642aae3fe6c68d6c7264.tar.gz android_packages_apps_Trebuchet-fe70926e116fca0d84b3642aae3fe6c68d6c7264.tar.bz2 android_packages_apps_Trebuchet-fe70926e116fca0d84b3642aae3fe6c68d6c7264.zip |
Reimplement CM Settings Overview Panel in the new Launcher Part 2
- Enables hiding the search bar from the workspace
- Adds a reload launcher flag to reload only during onResume or newIntent if needed
Change-Id: I0feb279f9003b268b5a129cef40d3665787ee451
Diffstat (limited to 'src/com/android/launcher3/IconCache.java')
-rw-r--r-- | src/com/android/launcher3/IconCache.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/com/android/launcher3/IconCache.java b/src/com/android/launcher3/IconCache.java index 59ab8397d..c5eeba69d 100644 --- a/src/com/android/launcher3/IconCache.java +++ b/src/com/android/launcher3/IconCache.java @@ -52,8 +52,10 @@ import com.android.launcher3.util.Thunk; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; +import java.util.Iterator; import java.util.List; import java.util.Locale; +import java.util.Map; import java.util.Set; import java.util.Stack; @@ -198,6 +200,20 @@ public class IconCache { } /** + * Empty out the cache that aren't of the correct grid size + */ + public synchronized void flushInvalidIcons(DeviceProfile deviceProfile) { + Iterator<Map.Entry<ComponentKey, CacheEntry>> it = mCache.entrySet().iterator(); + while (it.hasNext()) { + final CacheEntry e = it.next().getValue(); + if ((e.icon != null) && (e.icon.getWidth() < deviceProfile.iconSizePx + || e.icon.getHeight() < deviceProfile.iconSizePx)) { + it.remove(); + } + } + } + + /** * Remove any records for the supplied package name from memory. */ private void removeFromMemCacheLocked(String packageName, UserHandleCompat user) { |