Revert "Exception if receive move withouth down"
This reverts commit a0a20dc23babe74e4ba59262323280367ad76185.
Reason for revert: This is causing a number of fatal crashes in SystemUI. See b/158081578, b/158057055, b/158060735, and b/158061923.
Fixes: 158081578
Fixes: 158057055
Fixes: 158060735
Fixes: 158061923
Change-Id: If7e6cd4ade3df540ba7d97d9265564132a235292
(cherry picked from commit 0ef6f01bd1f47594af77d5024a8115dfd2b46116)
diff --git a/core/java/android/view/GestureDetector.java b/core/java/android/view/GestureDetector.java
index a9af595..f6c72c4 100644
--- a/core/java/android/view/GestureDetector.java
+++ b/core/java/android/view/GestureDetector.java
@@ -289,11 +289,6 @@
private VelocityTracker mVelocityTracker;
/**
- * True if the detector can throw exception when touch steam is unexpected .
- */
- private boolean mExceptionForTouchStream;
-
- /**
* Consistency verifier for debugging purposes.
*/
private final InputEventConsistencyVerifier mInputEventConsistencyVerifier =
@@ -472,8 +467,6 @@
mTouchSlopSquare = touchSlop * touchSlop;
mDoubleTapTouchSlopSquare = doubleTapTouchSlop * doubleTapTouchSlop;
mDoubleTapSlopSquare = doubleTapSlop * doubleTapSlop;
- mExceptionForTouchStream = context != null
- && context.getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.R;
}
/**
@@ -646,13 +639,6 @@
break;
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) {
break;
}