[omni] Let parent to allow intercept when it's in the 2nd stage.

Discussed with Andy for ideas - instead of passing the outer touch slop out, it might be easier to let parent to allow intercept when it's in the 2nd stage (e.g., OverviewInputConsumer doesn't have touch slop handling logic). So we can go through this if: https://source.corp.google.com/h/googleplex-android/platform/superproject/main/+/main:packages/apps/Launcher3/quickstep/src/com/android/quickstep/inputconsumers/NavHandleLongPressInputConsumer.java;l=105;drc=deee0d06f624223b808593997cf22042c9aa5142
`mDelegate` can be `OverviewInputConsumer` or `OtherActivityInputConsumer` or `TaskbarUnstashInputConsumer`.

Bug: 330446193
Flag: legacy ENABLE_LPNH_TWO_STAGES disabled
Test: manual
Change-Id: I1f33172f1614a750a01632c8c945ee5e5cbd7adc
This commit is contained in:
Holly Sun committed 2024-05-01 10:02:40 -07:00
1 parent 7f26505f04
commit 1d90321484
6 files changed
+50 -8

No files matched your search

@@ -42,6 +42,7 @@ import com.android.launcher3.taskbar.TaskbarTranslationController.TransitionCall
import com.android.launcher3.taskbar.bubbles.BubbleControllers;
import com.android.launcher3.touch.OverScroll;
import com.android.launcher3.util.DisplayController;
import com.android.quickstep.GestureState;
import com.android.quickstep.InputConsumer;
import com.android.quickstep.OverviewCommandHelper;
import com.android.systemui.shared.system.InputMonitorCompat;
@@ -76,10 +77,11 @@ public class TaskbarUnstashInputConsumer extends DelegateInputConsumer {
private final int mStashedTaskbarBottomEdge;
private final @Nullable TransitionCallback mTransitionCallback;
private final GestureState mGestureState;
public TaskbarUnstashInputConsumer(Context context, InputConsumer delegate,
InputMonitorCompat inputMonitor, TaskbarActivityContext taskbarActivityContext,
OverviewCommandHelper overviewCommandHelper) {
OverviewCommandHelper overviewCommandHelper, GestureState gestureState) {
super(delegate, inputMonitor);
mTaskbarActivityContext = taskbarActivityContext;
mOverviewCommandHelper = overviewCommandHelper;
@@ -103,6 +105,7 @@ public class TaskbarUnstashInputConsumer extends DelegateInputConsumer {
mTransitionCallback = mIsTransientTaskbar
? taskbarActivityContext.getTranslationCallbacks()
: null;
mGestureState = gestureState;
}
@Override
@@ -110,6 +113,11 @@ public class TaskbarUnstashInputConsumer extends DelegateInputConsumer {
return TYPE_TASKBAR_STASH | TYPE_CURSOR_HOVER | mDelegate.getType();
}
@Override
public boolean allowInterceptByParent() {
return super.allowInterceptByParent() && !mHasPassedTaskbarNavThreshold;
}
@Override
public void onMotionEvent(MotionEvent ev) {
if (mState != STATE_ACTIVE) {
@@ -173,7 +181,8 @@ public class TaskbarUnstashInputConsumer extends DelegateInputConsumer {
boolean passedTaskbarNavThreshold = dY < 0
&& Math.abs(dY) >= mTaskbarNavThreshold;
if (!mHasPassedTaskbarNavThreshold && passedTaskbarNavThreshold) {
if (!mHasPassedTaskbarNavThreshold && passedTaskbarNavThreshold
&& !mGestureState.isInExtendedSlopRegion()) {
mHasPassedTaskbarNavThreshold = true;
if (mIsInBubbleBarArea && mIsVerticalGestureOverBubbleBar) {
mTaskbarActivityContext.onSwipeToOpenBubblebar();