summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2011-08-17 16:10:46 -0700
committerAdam Cohen <adamcohen@google.com>2011-08-17 16:12:00 -0700
commitb0fa3529edf7c4f6ce088d23d80461dcad43aa15 (patch)
tree39395cb58edc3e79a3a1d50d295363689076a60c /src
parentfafa874d8bad3893c185fc1e41e1faf3ff450fe9 (diff)
downloadandroid_packages_apps_Trebuchet-b0fa3529edf7c4f6ce088d23d80461dcad43aa15.tar.gz
android_packages_apps_Trebuchet-b0fa3529edf7c4f6ce088d23d80461dcad43aa15.tar.bz2
android_packages_apps_Trebuchet-b0fa3529edf7c4f6ce088d23d80461dcad43aa15.zip
Fixing issue 4727712, widget list isn't always synced correctly
Change-Id: Iac7fc94d78915e53174ddc4b44854a45da72c443
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher2/AppsCustomizePagedView.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/com/android/launcher2/AppsCustomizePagedView.java b/src/com/android/launcher2/AppsCustomizePagedView.java
index 1da6fe07b..81586249f 100644
--- a/src/com/android/launcher2/AppsCustomizePagedView.java
+++ b/src/com/android/launcher2/AppsCustomizePagedView.java
@@ -324,6 +324,19 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
}
public void onPackagesUpdated() {
+ // TODO: this isn't ideal, but we actually need to delay here. This call is triggered
+ // by a broadcast receiver, and in order for it to work correctly, we need to know that
+ // the AppWidgetService has already received and processed the same broadcast. Since there
+ // is no guarantee about ordering of broadcast receipt, we just delay here. Ideally,
+ // we should have a more precise way of ensuring the AppWidgetService is up to date.
+ postDelayed(new Runnable() {
+ public void run() {
+ updatePackages();
+ }
+ }, 500);
+ }
+
+ public void updatePackages() {
// Get the list of widgets and shortcuts
boolean wasEmpty = mWidgets.isEmpty();
mWidgets.clear();