If we get TOUCH_UP before getting the WebCore's
response for TOUCH_DOWN, remove the pending TOUCH_EVENT
before proceeding to fling.
This is partial fix for
http://b/issue?id=2450534
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index 9af2d51..6d82797 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -4441,6 +4441,14 @@
if (mFullScreenHolder == null
&& (computeHorizontalScrollExtent() < computeHorizontalScrollRange()
|| computeVerticalScrollExtent() < computeVerticalScrollRange())) {
+ // remove the pending TOUCH_EVENT and send a
+ // cancel
+ mWebViewCore
+ .removeMessages(EventHub.TOUCH_EVENT);
+ WebViewCore.TouchEventData ted = new WebViewCore.TouchEventData();
+ ted.mAction = MotionEvent.ACTION_CANCEL;
+ mWebViewCore.sendMessage(EventHub.TOUCH_EVENT,
+ ted);
// we will not rewrite drag code here, but we
// will try fling if it applies.
WebViewCore.pauseUpdate(mWebViewCore);