diff options
author | Tony Wickham <twickham@google.com> | 2017-04-13 16:24:38 -0700 |
---|---|---|
committer | Tony Wickham <twickham@google.com> | 2017-04-20 15:10:38 -0700 |
commit | a7e1c1c08854930ddb4366698d5bf079ae0536f3 (patch) | |
tree | 7ca715956276ac891cd4f5eced4db8c84a15633f /src/com/android/launcher3/LauncherModel.java | |
parent | 343a77e609382bcb9b1d69ea235a9e6d779b719e (diff) | |
download | android_packages_apps_Trebuchet-a7e1c1c08854930ddb4366698d5bf079ae0536f3.tar.gz android_packages_apps_Trebuchet-a7e1c1c08854930ddb4366698d5bf079ae0536f3.tar.bz2 android_packages_apps_Trebuchet-a7e1c1c08854930ddb4366698d5bf079ae0536f3.zip |
Only add widgets system shortcut if widgets exist
Before we were adding it in a disabled state, and then enabling it once
widgets were bound (if widgets existed for that app). Now we load all
widgets when launcher starts so that we can use the values for the
purpose of animating the popup container. Then, as the container opens,
we reload widgets/shortcuts for that particular app and add/remove the
widgets shortcut if necessary.
Bug: 34940468
Change-Id: I64bd009442d10d3d1f9a977bdedfdb639a7dd193
Diffstat (limited to 'src/com/android/launcher3/LauncherModel.java')
-rw-r--r-- | src/com/android/launcher3/LauncherModel.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java index f8c591c13..3793bb5a0 100644 --- a/src/com/android/launcher3/LauncherModel.java +++ b/src/com/android/launcher3/LauncherModel.java @@ -732,6 +732,16 @@ public class LauncherModel extends BroadcastReceiver if (DEBUG_LOADERS) Log.d(TAG, "step 3.2: bind deep shortcuts"); bindDeepShortcuts(); + // Take a break + if (DEBUG_LOADERS) Log.d(TAG, "step 3 completed, wait for idle"); + waitForIdle(); + verifyNotStopped(); + + // fourth step + if (DEBUG_LOADERS) Log.d(TAG, "step 4.1: loading widgets"); + refreshAndBindWidgetsAndShortcuts(getCallback(), false /* bindFirst */, + null /* packageUser */); + synchronized (mLock) { // Everything loaded bind the data. mModelLoaded = true; |