Merge "Add method to set action button on MotionEvent" into mnc-dev

This commit is contained in:
Michael Wright
2015-06-23 12:48:52 +00:00
committed by Android (Google) Code Review
2 changed files with 20 additions and 0 deletions

View File

@@ -1399,6 +1399,7 @@ public final class MotionEvent extends InputEvent implements Parcelable {
private static native int nativeGetButtonState(long nativePtr);
private static native void nativeSetButtonState(long nativePtr, int buttonState);
private static native int nativeGetActionButton(long nativePtr);
private static native void nativeSetActionButton(long nativePtr, int actionButton);
private static native void nativeOffsetLocation(long nativePtr, float deltaX, float deltaY);
private static native float nativeGetXOffset(long nativePtr);
private static native float nativeGetYOffset(long nativePtr);
@@ -2283,6 +2284,16 @@ public final class MotionEvent extends InputEvent implements Parcelable {
return nativeGetActionButton(mNativePtr);
}
/**
* Sets the action button for the event.
*
* @see #getActionButton()
* @hide
*/
public final void setActionButton(int button) {
nativeSetActionButton(mNativePtr, button);
}
/**
* Returns the original raw X coordinate of this event. For touch
* events on the screen, this is the original location of the event