summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2015-04-21 01:19:25 (GMT)
committerSunny Goyal <sunnygoyal@google.com>2015-04-21 01:19:25 (GMT)
commit7e2a3608b6fa51c884e051625e10d13597cb8796 (patch)
tree590f8fabf034acd97e79ac02fa1122e4cd6289d0
parentd5a03eb0b3015e8d307299ea2c8771b3b204a6ea (diff)
downloadandroid_packages_apps_Trebuchet-7e2a3608b6fa51c884e051625e10d13597cb8796.zip
android_packages_apps_Trebuchet-7e2a3608b6fa51c884e051625e10d13597cb8796.tar.gz
android_packages_apps_Trebuchet-7e2a3608b6fa51c884e051625e10d13597cb8796.tar.bz2
Preventing concurrent modification exception during widget restore
Change-Id: If896c5ea7136d132f30be8127b651449bde17447
-rw-r--r--src/com/android/launcher3/LauncherAppWidgetHost.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/com/android/launcher3/LauncherAppWidgetHost.java b/src/com/android/launcher3/LauncherAppWidgetHost.java
index a28fd25..583f85a 100644
--- a/src/com/android/launcher3/LauncherAppWidgetHost.java
+++ b/src/com/android/launcher3/LauncherAppWidgetHost.java
@@ -84,8 +84,10 @@ public class LauncherAppWidgetHost extends AppWidgetHost {
mLauncher.bindPackagesUpdated(LauncherModel.getSortedWidgetsAndShortcuts(mLauncher,
true /* refresh */));
- for (Runnable callback : mProviderChangeListeners) {
- callback.run();
+ if (!mProviderChangeListeners.isEmpty()) {
+ for (Runnable callback : new ArrayList<>(mProviderChangeListeners)) {
+ callback.run();
+ }
}
}