summaryrefslogtreecommitdiff
path: root/quickstep/src
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2021-05-20 13:17:44 -0700
committerWinson Chung <winsonc@google.com>2021-05-20 14:50:33 -0700
commitbd2fa26bdaa2e80f31eaef7ad6cdea83d5bd111c (patch)
tree9c08cc3cd1204baf93d05e69991c05e3ce380ed0 /quickstep/src
parent631767d919f30e4a6ff71e867fcab90e6f2a85bd (diff)
Tweak ordering of first match search
- Tweak iteration for finding first match, go by operator priority and check each cell layout by order to return the first view that matches - Also reset the launch cookie in cases where we're launching a task that doesn't support cookies (ie. via prediction), otherwise we may still try to associate it with the last launched cookie later Fixes: 187720286 Test: Swipe up from various icon types across hotseat/workspace Change-Id: I71c4c13c442b0884b2247589685f976eaaeb30a4 Signed-off-by: Winson Chung <winsonc@google.com>
Diffstat (limited to 'quickstep/src')
-rw-r--r--quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java5
-rw-r--r--quickstep/src/com/android/quickstep/LauncherSwipeHandlerV2.java3
2 files changed, 7 insertions, 1 deletions
diff --git a/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java b/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java
index e777ee7354..25e23594ac 100644
--- a/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java
+++ b/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java
@@ -20,6 +20,7 @@ import static com.android.launcher3.AbstractFloatingView.TYPE_HIDE_BACK_BUTTON;
import static com.android.launcher3.LauncherState.FLAG_HIDE_BACK_BUTTON;
import static com.android.launcher3.LauncherState.NORMAL;
import static com.android.launcher3.LauncherState.NO_OFFSET;
+import static com.android.launcher3.model.data.ItemInfo.NO_MATCHING_ID;
import static com.android.launcher3.util.DisplayController.CHANGE_ACTIVE_SCREEN;
import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
import static com.android.quickstep.SysUINavigationMode.Mode.TWO_BUTTONS;
@@ -499,6 +500,8 @@ public abstract class BaseQuickstepLauncher extends Launcher
// Also allow swiping to folders
break;
}
+ // Reset any existing launch cookies associated with the cookie
+ opts.setLaunchCookie(ObjectWrapper.wrap(NO_MATCHING_ID));
return;
}
switch (info.itemType) {
@@ -509,6 +512,8 @@ public abstract class BaseQuickstepLauncher extends Launcher
// Fall through and continue if it's an app, shortcut, or widget
break;
default:
+ // Reset any existing launch cookies associated with the cookie
+ opts.setLaunchCookie(ObjectWrapper.wrap(NO_MATCHING_ID));
return;
}
opts.setLaunchCookie(ObjectWrapper.wrap(new Integer(info.id)));
diff --git a/quickstep/src/com/android/quickstep/LauncherSwipeHandlerV2.java b/quickstep/src/com/android/quickstep/LauncherSwipeHandlerV2.java
index 811af7e658..1bae1c5f6b 100644
--- a/quickstep/src/com/android/quickstep/LauncherSwipeHandlerV2.java
+++ b/quickstep/src/com/android/quickstep/LauncherSwipeHandlerV2.java
@@ -21,6 +21,7 @@ import static com.android.launcher3.LauncherState.NORMAL;
import static com.android.launcher3.Utilities.boundToRange;
import static com.android.launcher3.Utilities.dpToPx;
import static com.android.launcher3.config.FeatureFlags.PROTOTYPE_APP_CLOSE;
+import static com.android.launcher3.model.data.ItemInfo.NO_MATCHING_ID;
import static com.android.launcher3.views.FloatingIconView.SHAPE_PROGRESS_DURATION;
import static com.android.launcher3.views.FloatingIconView.getFloatingIconView;
@@ -234,7 +235,7 @@ public class LauncherSwipeHandlerV2 extends
// Find the associated item info for the launch cookie (if available), note that predicted
// apps actually have an id of -1, so use another default id here
- int launchCookieItemId = -2;
+ int launchCookieItemId = NO_MATCHING_ID;
for (IBinder cookie : launchCookies) {
Integer itemId = ObjectWrapper.unwrap(cookie);
if (itemId != null) {