summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2013-10-14 17:23:01 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-10-14 17:23:01 -0700
commit540514f399e09113ae321933af8849e09e088c70 (patch)
treec178c90835275ffcbe4c91a1d7615d2657c22ea9
parent6bef14bb4c4c54728cd9da63ca33ce84a900bc22 (diff)
parente5467dccdd26ff912afb43d626346e4506c9c062 (diff)
downloadandroid_packages_apps_Trebuchet-540514f399e09113ae321933af8849e09e088c70.tar.gz
android_packages_apps_Trebuchet-540514f399e09113ae321933af8849e09e088c70.tar.bz2
android_packages_apps_Trebuchet-540514f399e09113ae321933af8849e09e088c70.zip
am e5467dcc: Flushing icons of the wrong size. (Bug 11203738)
* commit 'e5467dccdd26ff912afb43d626346e4506c9c062': Flushing icons of the wrong size. (Bug 11203738)
-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();