am bcff7eda: am 9dc25f06: Merge "Fixing concurrent modification exception when iterating through new apps list. (Bug 6621553)" into jb-dev

* commit 'bcff7eda3731b7af254a1d5182766683ea1d46e3':
  Fixing concurrent modification exception when iterating through new apps list. (Bug 6621553)
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java
index ede7d88..1bd0a35 100644
--- a/src/com/android/launcher2/Workspace.java
+++ b/src/com/android/launcher2/Workspace.java
@@ -3658,12 +3658,13 @@
                     // 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) {}
                             }