summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2013-10-15 11:06:24 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-10-15 11:06:24 -0700
commitedc43805e3d65608b39d9271aee97e45904d85dd (patch)
tree5392ea8cb6f27b0198bba81f89fe85b98e1a1e66 /src/com
parent540514f399e09113ae321933af8849e09e088c70 (diff)
parentb6d33df9092cacfda1768ffdb96a0770c861566d (diff)
downloadandroid_packages_apps_Trebuchet-edc43805e3d65608b39d9271aee97e45904d85dd.tar.gz
android_packages_apps_Trebuchet-edc43805e3d65608b39d9271aee97e45904d85dd.tar.bz2
android_packages_apps_Trebuchet-edc43805e3d65608b39d9271aee97e45904d85dd.zip
am b6d33df9: Fix concurrent modifcation exception (issue 11234805)
* commit 'b6d33df9092cacfda1768ffdb96a0770c861566d': Fix concurrent modifcation exception (issue 11234805)
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/launcher3/IconCache.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/com/android/launcher3/IconCache.java b/src/com/android/launcher3/IconCache.java
index 2aab68bee..543b8ee2d 100644
--- a/src/com/android/launcher3/IconCache.java
+++ b/src/com/android/launcher3/IconCache.java
@@ -29,6 +29,8 @@ import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map.Entry;
/**
* Cache of application icons. Icons can be made from any thread.
@@ -151,10 +153,11 @@ public class IconCache {
*/
public void flushInvalidIcons(DeviceProfile grid) {
synchronized (mCache) {
- for (ComponentName cn : mCache.keySet()) {
- final CacheEntry e = mCache.get(cn);
+ Iterator<Entry<ComponentName, CacheEntry>> it = mCache.entrySet().iterator();
+ while (it.hasNext()) {
+ final CacheEntry e = it.next().getValue();
if (e.icon.getWidth() != grid.iconSizePx || e.icon.getHeight() != grid.iconSizePx) {
- mCache.remove(cn);
+ it.remove();
}
}
}