Merge "Revert "Exception if receive move withouth down"" into rvc-dev am: b1d2c79448

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11694777

Change-Id: I84c1bd4e1a48269e979df3f2fe3432b4516ee0d2
This commit is contained in:
Robert Snoeberger
2020-06-03 20:19:36 +00:00
committed by Automerger Merge Worker

View File

@@ -288,11 +288,6 @@ public class GestureDetector {
*/ */
private VelocityTracker mVelocityTracker; private VelocityTracker mVelocityTracker;
/**
* True if the detector can throw exception when touch steam is unexpected .
*/
private boolean mExceptionForTouchStream;
/** /**
* Consistency verifier for debugging purposes. * Consistency verifier for debugging purposes.
*/ */
@@ -472,8 +467,6 @@ public class GestureDetector {
mTouchSlopSquare = touchSlop * touchSlop; mTouchSlopSquare = touchSlop * touchSlop;
mDoubleTapTouchSlopSquare = doubleTapTouchSlop * doubleTapTouchSlop; mDoubleTapTouchSlopSquare = doubleTapTouchSlop * doubleTapTouchSlop;
mDoubleTapSlopSquare = doubleTapSlop * doubleTapSlop; mDoubleTapSlopSquare = doubleTapSlop * doubleTapSlop;
mExceptionForTouchStream = context != null
&& context.getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.R;
} }
/** /**
@@ -646,13 +639,6 @@ public class GestureDetector {
break; break;
case MotionEvent.ACTION_MOVE: case MotionEvent.ACTION_MOVE:
if (mExceptionForTouchStream && !mStillDown) {
throw new IllegalStateException("Incomplete event stream received: "
+ "Received ACTION_MOVE before ACTION_DOWN. ACTION_DOWN must precede "
+ "ACTION_MOVE following ACTION_UP or ACTION_CANCEL, or when this "
+ "GestureDetector has not yet received any events.");
}
if (mInLongPress || mInContextClick) { if (mInLongPress || mInContextClick) {
break; break;
} }