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:
Huahui Wu
2011-03-13 18:13:42 -07:00
parent ff6f4c2eff
commit 2d3ef37ae6
2 changed files with 7 additions and 2 deletions

View File

@@ -5955,6 +5955,10 @@ public class WebView extends AbsoluteLayout
int y = viewToContentY((int) ev.getY(c) + mScrollY);
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.mReprocess = true;
ted.mMotionEvent = MotionEvent.obtain(ev);

View File

@@ -563,7 +563,7 @@ final class WebViewCore {
int framePtr, int nodePtr, int x, int y);
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();
@@ -820,6 +820,7 @@ final class WebViewCore {
int mAction;
int[] mIds; // Ids of the touch points
Point[] mPoints;
int mActionIndex; // Associated pointer index for ACTION_POINTER_DOWN/UP
int mMetaState;
boolean mReprocess;
MotionEvent mMotionEvent;
@@ -1335,7 +1336,7 @@ final class WebViewCore {
ted.mNativeLayerRect);
}
ted.mNativeResult = nativeHandleTouchEvent(ted.mAction, ted.mIds,
xArray, yArray, count, ted.mMetaState);
xArray, yArray, count, ted.mActionIndex, ted.mMetaState);
Message.obtain(
mWebView.mPrivateHandler,
WebView.PREVENT_TOUCH_ID,