summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/Launcher.java
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2015-05-05 10:05:08 -0700
committerWinson Chung <winsonc@google.com>2015-05-05 10:05:08 -0700
commitbb785c6eb38f9c4b1f71920cb6e57ca8f11d4908 (patch)
tree41f5bffca4f485aee4b1483d8ff6499e3fe38c1e /src/com/android/launcher3/Launcher.java
parentb6cd62cdad2ca3cefcbdc808faf6556a8a6c3c1d (diff)
downloadandroid_packages_apps_Trebuchet-bb785c6eb38f9c4b1f71920cb6e57ca8f11d4908.tar.gz
android_packages_apps_Trebuchet-bb785c6eb38f9c4b1f71920cb6e57ca8f11d4908.tar.bz2
android_packages_apps_Trebuchet-bb785c6eb38f9c4b1f71920cb6e57ca8f11d4908.zip
Ensuring we wait until resume before binding all apps.
Bug: 20759810
Diffstat (limited to 'src/com/android/launcher3/Launcher.java')
-rw-r--r--src/com/android/launcher3/Launcher.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 4533089e9..339b4e498 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -4166,11 +4166,28 @@ public class Launcher extends Activity
}
/**
+ * A runnable that we can dequeue and re-enqueue when all applications are bound (to prevent
+ * multiple calls to bind the same list.)
+ */
+ @Thunk ArrayList<AppInfo> mTmpAppsList;
+ private Runnable mBindAllApplicationsRunnable = new Runnable() {
+ public void run() {
+ bindAllApplications(mTmpAppsList);
+ mTmpAppsList = null;
+ }
+ };
+
+ /**
* Add the icons for all apps.
*
* Implementation of the method from LauncherModel.Callbacks.
*/
public void bindAllApplications(final ArrayList<AppInfo> apps) {
+ if (waitUntilResume(mBindAllApplicationsRunnable, true)) {
+ mTmpAppsList = apps;
+ return;
+ }
+
if (mAppsView != null) {
mAppsView.setApps(apps);
}