Merge "Add implementation for new NDK functions added to input.h"
This commit is contained in:
committed by
Android (Google) Code Review
commit
786accc8b8
@@ -283,6 +283,21 @@ float AMotionEvent_getHistoricalAxisValue(const AInputEvent* motion_event,
|
||||
axis, pointer_index, history_index);
|
||||
}
|
||||
|
||||
int32_t AMotionEvent_getActionButton(const AInputEvent* motion_event) {
|
||||
return static_cast<const MotionEvent*>(motion_event)->getActionButton();
|
||||
}
|
||||
|
||||
int32_t AMotionEvent_getClassification(const AInputEvent* motion_event) {
|
||||
switch (static_cast<const MotionEvent*>(motion_event)->getClassification()) {
|
||||
case android::MotionClassification::NONE:
|
||||
return AMOTION_EVENT_CLASSIFICATION_NONE;
|
||||
case android::MotionClassification::AMBIGUOUS_GESTURE:
|
||||
return AMOTION_EVENT_CLASSIFICATION_AMBIGUOUS_GESTURE;
|
||||
case android::MotionClassification::DEEP_PRESS:
|
||||
return AMOTION_EVENT_CLASSIFICATION_DEEP_PRESS;
|
||||
}
|
||||
}
|
||||
|
||||
const AInputEvent* AMotionEvent_fromJava(JNIEnv* env, jobject motionEvent) {
|
||||
MotionEvent* eventSrc = android::android_view_MotionEvent_getNativePtr(env, motionEvent);
|
||||
if (eventSrc == nullptr) {
|
||||
|
||||
@@ -114,8 +114,10 @@ LIBANDROID {
|
||||
ALooper_removeFd;
|
||||
ALooper_wake;
|
||||
AMotionEvent_getAction;
|
||||
AMotionEvent_getActionButton; # introduced=Tiramisu
|
||||
AMotionEvent_getAxisValue; # introduced-arm=13 introduced-arm64=21 introduced-mips=13 introduced-mips64=21 introduced-x86=13 introduced-x86_64=21
|
||||
AMotionEvent_getButtonState; # introduced-arm=14 introduced-arm64=21 introduced-mips=14 introduced-mips64=21 introduced-x86=14 introduced-x86_64=21
|
||||
AMotionEvent_getClassification; # introduced=Tiramisu
|
||||
AMotionEvent_getDownTime;
|
||||
AMotionEvent_getEdgeFlags;
|
||||
AMotionEvent_getEventTime;
|
||||
|
||||
Reference in New Issue
Block a user