diff options
author | Winson Chung <winsonc@google.com> | 2012-06-25 14:21:37 -0700 |
---|---|---|
committer | Winson Chung <winsonc@google.com> | 2012-06-25 14:23:29 -0700 |
commit | 3df7dcf513e0e38ab621d38e318bdefb96f0aa81 (patch) | |
tree | ba4422b9dca37cc65e2fc841c8d99bcef0496c29 /src/com/android/launcher2 | |
parent | 7e4e4ba494e50d918a1573b2fa601c561037deae (diff) | |
download | packages_apps_trebuchet-3df7dcf513e0e38ab621d38e318bdefb96f0aa81.zip packages_apps_trebuchet-3df7dcf513e0e38ab621d38e318bdefb96f0aa81.tar.gz packages_apps_trebuchet-3df7dcf513e0e38ab621d38e318bdefb96f0aa81.tar.bz2 |
Fixing concurrent modification exception when iterating through new apps list. (Bug 6621553)
Change-Id: Idf4fae51c65e0e53520740dd0b2050eeac00b251
Diffstat (limited to 'src/com/android/launcher2')
-rw-r--r-- | src/com/android/launcher2/Workspace.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java index 0192630..2d2340a 100644 --- a/src/com/android/launcher2/Workspace.java +++ b/src/com/android/launcher2/Workspace.java @@ -3684,12 +3684,13 @@ public class Workspace extends SmoothPagedView // Remove all queued items that match the same package if (newApps != null) { synchronized (newApps) { - for (String intentStr : newApps) { + Iterator<String> iter = newApps.iterator(); + while (iter.hasNext()) { try { - Intent intent = Intent.parseUri(intentStr, 0); + Intent intent = Intent.parseUri(iter.next(), 0); String pn = ItemInfo.getPackageName(intent); if (packageNames.contains(pn)) { - newApps.remove(intentStr); + iter.remove(); } } catch (URISyntaxException e) {} } |