diff options
author | Govinda Wasserman <gwasserman@google.com> | 2020-03-05 16:50:22 -0500 |
---|---|---|
committer | Govinda Wasserman <gwasserman@google.com> | 2020-03-12 19:04:41 -0400 |
commit | 97ce9ee93fd290d706f89c2819c21fea3a508bdf (patch) | |
tree | a961255f397c9d312a40c80e52043dab38c1d192 /quickstep/recents_ui_overrides/src/com/android | |
parent | d5cafac586093baea87ca628aaeb4fce10774dc6 (diff) | |
download | packages_apps_Trebuchet-97ce9ee93fd290d706f89c2819c21fea3a508bdf.tar.gz packages_apps_Trebuchet-97ce9ee93fd290d706f89c2819c21fea3a508bdf.tar.bz2 packages_apps_Trebuchet-97ce9ee93fd290d706f89c2819c21fea3a508bdf.zip |
[DO NOT MERGE] Adds fling gesture suppression to Launcher
Test: Tested locally
BUG: 150688842
Change-Id: Ifa96bd01363de47cf1d8cdce34d81d525c8c2c04
Diffstat (limited to 'quickstep/recents_ui_overrides/src/com/android')
2 files changed, 21 insertions, 9 deletions
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java index f32182600..2fa789fd6 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java @@ -563,9 +563,13 @@ public class TouchInteractionService extends Service implements // not interrupt it. QuickSwitch assumes that interruption can only happen if the // next gesture is also quick switch. mUncheckedConsumer = - new AssistantTouchConsumer(this, mISystemUiProxy, + new AssistantTouchConsumer( + this, + mISystemUiProxy, mOverviewComponentObserver.getActivityControlHelper(), - InputConsumer.NO_OP, mInputMonitorCompat); + InputConsumer.NO_OP, + mInputMonitorCompat, + mOverviewComponentObserver.assistantGestureIsConstrained()); } else { mUncheckedConsumer = InputConsumer.NO_OP; } @@ -612,8 +616,13 @@ public class TouchInteractionService extends Service implements final ActivityControlHelper activityControl = mOverviewComponentObserver.getActivityControlHelper(); if (canTriggerAssistantAction(event)) { - base = new AssistantTouchConsumer(this, mISystemUiProxy, activityControl, base, - mInputMonitorCompat); + base = new AssistantTouchConsumer( + this, + mISystemUiProxy, + activityControl, + base, + mInputMonitorCompat, + mOverviewComponentObserver.assistantGestureIsConstrained()); } if ((mSystemUiStateFlags & SYSUI_STATE_SCREEN_PINNING) != 0) { diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/AssistantTouchConsumer.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/AssistantTouchConsumer.java index 346969e59..d4cdaf040 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/AssistantTouchConsumer.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/AssistantTouchConsumer.java @@ -91,14 +91,16 @@ public class AssistantTouchConsumer extends DelegateInputConsumer { private final ISystemUiProxy mSysUiProxy; private final Context mContext; private final GestureDetector mGestureDetector; + private final boolean mIsAssistGestureConstrained; public AssistantTouchConsumer(Context context, ISystemUiProxy systemUiProxy, ActivityControlHelper activityControlHelper, InputConsumer delegate, - InputMonitorCompat inputMonitor) { + InputMonitorCompat inputMonitor, boolean isAssistGestureConstrained) { super(delegate, inputMonitor); final Resources res = context.getResources(); mContext = context; mSysUiProxy = systemUiProxy; + mIsAssistGestureConstrained = isAssistGestureConstrained; mDragDistThreshold = res.getDimension(R.dimen.gestures_assistant_drag_threshold); mFlingDistThreshold = res.getDimension(R.dimen.gestures_assistant_fling_threshold); mTimeThreshold = res.getInteger(R.integer.assistant_gesture_min_time_threshold); @@ -273,10 +275,11 @@ public class AssistantTouchConsumer extends DelegateInputConsumer { private class AssistantGestureListener extends SimpleOnGestureListener { @Override public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { - if (isValidAssistantGestureAngle(velocityX, -velocityY) - && mDistance >= mFlingDistThreshold - && !mLaunchedAssistant - && mState != STATE_DELEGATE_ACTIVE) { + if (!mIsAssistGestureConstrained + && isValidAssistantGestureAngle(velocityX, -velocityY) + && mDistance >= mFlingDistThreshold + && !mLaunchedAssistant + && mState != STATE_DELEGATE_ACTIVE) { mLastProgress = 1; try { mSysUiProxy.onAssistantGestureCompletion( |