diff options
Diffstat (limited to 'quickstep/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java')
-rw-r--r-- | quickstep/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/quickstep/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java index 7e6116720b..eedd20485b 100644 --- a/quickstep/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java +++ b/quickstep/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java @@ -40,7 +40,6 @@ import android.os.Build; import android.util.Log; import android.view.MotionEvent; import android.view.VelocityTracker; -import android.view.ViewConfiguration; import androidx.annotation.UiThread; @@ -125,6 +124,9 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC // Might be displacement in X or Y, depending on the direction we are swiping from the nav bar. private float mStartDisplacement; + // The callback called upon finishing the recents transition if it was force-canceled + private Runnable mForceFinishRecentsTransitionCallback; + public OtherActivityInputConsumer(Context base, RecentsAnimationDeviceState deviceState, TaskAnimationManager taskAnimationManager, GestureState gestureState, boolean isDeferredDownTarget, Consumer<OtherActivityInputConsumer> onCompleteCallback, @@ -151,7 +153,7 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC boolean continuingPreviousGesture = mTaskAnimationManager.isRecentsAnimationRunning(); mIsDeferredDownTarget = !continuingPreviousGesture && isDeferredDownTarget; - mTouchSlop = ViewConfiguration.get(this).getScaledTouchSlop(); + mTouchSlop = mDeviceState.getTouchSlop(); mSquaredTouchSlop = mDeviceState.getSquaredTouchSlop(); mPassedPilferInputSlop = mPassedWindowMoveSlop = continuingPreviousGesture; @@ -411,6 +413,14 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC } /** + * Returns whether this input consumer has started touch tracking (if touch tracking is not + * deferred). + */ + public boolean hasStartedTouchTracking() { + return mInteractionHandler != null; + } + + /** * Called when the gesture has ended. Does not correlate to the completion of the interaction as * the animation can still be running. */ @@ -444,7 +454,7 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC // animateToProgress so we have to manually finish here. In the case of // ACTION_CANCEL, someone else may be doing something so finish synchronously. mTaskAnimationManager.finishRunningRecentsAnimation(false /* toHome */, - isCanceled /* forceFinish */); + isCanceled /* forceFinish */, mForceFinishRecentsTransitionCallback); } else { // The animation hasn't started yet, so insert a replacement handler into the // callbacks which immediately finishes the animation after it starts. @@ -513,6 +523,14 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC } /** + * Sets a callback to be called when the recents transition is force-canceled by another input + * consumer being made active. + */ + public void setForceFinishRecentsTransitionCallback(Runnable r) { + mForceFinishRecentsTransitionCallback = r; + } + + /** * A listener which just finishes the animation immediately after starting. Replaces * AbsSwipeUpHandler if the gesture itself finishes before the animation even starts. */ |