b/3392594 keep the remain touch points when one is ended.
This is the Java side code change for b/3392594. It adds an action index into the touch event data and pass it to the native side. Change-Id: Ibb393e62a590d0fff1dd3172041748e2b10501d6
This commit is contained in:
committed by
Android Git Automerger
parent
9e173ececf
commit
cc8fa160fb
@@ -5964,6 +5964,10 @@ public class WebView extends AbsoluteLayout
|
|||||||
int y = viewToContentY((int) ev.getY(c) + mScrollY);
|
int y = viewToContentY((int) ev.getY(c) + mScrollY);
|
||||||
ted.mPoints[c] = new Point(x, y);
|
ted.mPoints[c] = new Point(x, y);
|
||||||
}
|
}
|
||||||
|
if (ted.mAction == MotionEvent.ACTION_POINTER_DOWN
|
||||||
|
|| ted.mAction == MotionEvent.ACTION_POINTER_UP) {
|
||||||
|
ted.mActionIndex = ev.getActionIndex();
|
||||||
|
}
|
||||||
ted.mMetaState = ev.getMetaState();
|
ted.mMetaState = ev.getMetaState();
|
||||||
ted.mReprocess = true;
|
ted.mReprocess = true;
|
||||||
ted.mMotionEvent = MotionEvent.obtain(ev);
|
ted.mMotionEvent = MotionEvent.obtain(ev);
|
||||||
|
|||||||
@@ -572,7 +572,7 @@ final class WebViewCore {
|
|||||||
int framePtr, int nodePtr, int x, int y);
|
int framePtr, int nodePtr, int x, int y);
|
||||||
|
|
||||||
private native boolean nativeHandleTouchEvent(int action, int[] idArray,
|
private native boolean nativeHandleTouchEvent(int action, int[] idArray,
|
||||||
int[] xArray, int[] yArray, int count, int metaState);
|
int[] xArray, int[] yArray, int count, int actionIndex, int metaState);
|
||||||
|
|
||||||
private native void nativeUpdateFrameCache();
|
private native void nativeUpdateFrameCache();
|
||||||
|
|
||||||
@@ -829,6 +829,7 @@ final class WebViewCore {
|
|||||||
int mAction;
|
int mAction;
|
||||||
int[] mIds; // Ids of the touch points
|
int[] mIds; // Ids of the touch points
|
||||||
Point[] mPoints;
|
Point[] mPoints;
|
||||||
|
int mActionIndex; // Associated pointer index for ACTION_POINTER_DOWN/UP
|
||||||
int mMetaState;
|
int mMetaState;
|
||||||
boolean mReprocess;
|
boolean mReprocess;
|
||||||
MotionEvent mMotionEvent;
|
MotionEvent mMotionEvent;
|
||||||
@@ -1344,7 +1345,7 @@ final class WebViewCore {
|
|||||||
ted.mNativeLayerRect);
|
ted.mNativeLayerRect);
|
||||||
}
|
}
|
||||||
ted.mNativeResult = nativeHandleTouchEvent(ted.mAction, ted.mIds,
|
ted.mNativeResult = nativeHandleTouchEvent(ted.mAction, ted.mIds,
|
||||||
xArray, yArray, count, ted.mMetaState);
|
xArray, yArray, count, ted.mActionIndex, ted.mMetaState);
|
||||||
Message.obtain(
|
Message.obtain(
|
||||||
mWebView.mPrivateHandler,
|
mWebView.mPrivateHandler,
|
||||||
WebView.PREVENT_TOUCH_ID,
|
WebView.PREVENT_TOUCH_ID,
|
||||||
|
|||||||
Reference in New Issue
Block a user