diff options
author | Adam Cohen <adamcohen@google.com> | 2014-09-20 06:45:53 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-09-20 06:45:54 +0000 |
commit | d8f6253e67d23dcdcf521b0558f193ae832743b2 (patch) | |
tree | 7802d47503458bdbde863366ae49f46115a7afc4 /src/com/android | |
parent | 68207e2532b2059e513a1c4e33c3c52e1ac1e559 (diff) | |
parent | 83079e43aed96d8b04358840399490d0c707b53d (diff) | |
download | android_packages_apps_Trebuchet-d8f6253e67d23dcdcf521b0558f193ae832743b2.tar.gz android_packages_apps_Trebuchet-d8f6253e67d23dcdcf521b0558f193ae832743b2.tar.bz2 android_packages_apps_Trebuchet-d8f6253e67d23dcdcf521b0558f193ae832743b2.zip |
Merge "When ensuring screen exists, make sure it's actually referring to a screen, not a rank" into ub-now-porkchop
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/launcher3/Launcher.java | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index eb505a372..7098760b3 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -721,8 +721,13 @@ public class Launcher extends Activity * a configuration step, this allows the proper animations to run after other transitions. */ private long completeAdd(PendingAddArguments args) { + long screenId = args.screenId; + if (args.container == LauncherSettings.Favorites.CONTAINER_DESKTOP) { + // When the screen id represents an actual screen (as opposed to a rank) we make sure + // that the drop page actually exists. + screenId = ensurePendingDropLayoutExists(args.screenId); + } - long screenId = ensurePendingDropLayoutExists(args.screenId); switch (args.requestCode) { case REQUEST_CREATE_SHORTCUT: completeAddShortcut(args.intent, args.container, screenId, args.cellX, @@ -814,7 +819,12 @@ public class Launcher extends Activity } } else { if (!workspaceLocked) { - mPendingAddInfo.screenId = ensurePendingDropLayoutExists(mPendingAddInfo.screenId); + if (mPendingAddInfo.container == LauncherSettings.Favorites.CONTAINER_DESKTOP) { + // When the screen id represents an actual screen (as opposed to a rank) + // we make sure that the drop page actually exists. + mPendingAddInfo.screenId = + ensurePendingDropLayoutExists(mPendingAddInfo.screenId); + } final CellLayout dropLayout = mWorkspace.getScreenWithId(mPendingAddInfo.screenId); dropLayout.setDropPending(true); |