summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2014-09-19 17:43:08 -0700
committerAdam Cohen <adamcohen@google.com>2014-09-19 17:46:32 -0700
commit83079e43aed96d8b04358840399490d0c707b53d (patch)
tree36a4509742017bd132519c701c0c416de009efe6
parentddd5aaaf354beb5add6bcc2560c4f975d49a9f6a (diff)
downloadandroid_packages_apps_Trebuchet-83079e43aed96d8b04358840399490d0c707b53d.tar.gz
android_packages_apps_Trebuchet-83079e43aed96d8b04358840399490d0c707b53d.tar.bz2
android_packages_apps_Trebuchet-83079e43aed96d8b04358840399490d0c707b53d.zip
When ensuring screen exists, make sure it's actually referring to a screen, not a rank
Bug: 17496589 Change-Id: If60e22dd71fa32530db91e37057689de5fb25646
-rw-r--r--src/com/android/launcher3/Launcher.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index b31e6fc77..22a72ab90 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);