Loading native/android/input.cpp +17 −0 Original line number Diff line number Diff line Loading @@ -314,6 +314,23 @@ const AInputEvent* AMotionEvent_fromJava(JNIEnv* env, jobject motionEvent) { return event; } jobject AInputEvent_toJava(JNIEnv* env, const AInputEvent* aInputEvent) { LOG_ALWAYS_FATAL_IF(aInputEvent == nullptr, "Expected aInputEvent to be non-null"); const int32_t eventType = AInputEvent_getType(aInputEvent); switch (eventType) { case AINPUT_EVENT_TYPE_MOTION: return android::android_view_MotionEvent_obtainAsCopy(env, static_cast<const MotionEvent&>( *aInputEvent)); case AINPUT_EVENT_TYPE_KEY: return android::android_view_KeyEvent_fromNative(env, static_cast<const KeyEvent&>( *aInputEvent)); default: LOG_ALWAYS_FATAL("Unexpected event type %d in AInputEvent_toJava.", eventType); } } void AInputQueue_attachLooper(AInputQueue* queue, ALooper* looper, int ident, ALooper_callbackFunc callback, void* data) { InputQueue* iq = static_cast<InputQueue*>(queue); Loading native/android/libandroid.map.txt +1 −0 Original line number Diff line number Diff line Loading @@ -90,6 +90,7 @@ LIBANDROID { AInputEvent_getSource; AInputEvent_getType; AInputEvent_release; # introduced=31 AInputEvent_toJava; # introduced=35 AInputQueue_attachLooper; AInputQueue_detachLooper; AInputQueue_finishEvent; Loading Loading
native/android/input.cpp +17 −0 Original line number Diff line number Diff line Loading @@ -314,6 +314,23 @@ const AInputEvent* AMotionEvent_fromJava(JNIEnv* env, jobject motionEvent) { return event; } jobject AInputEvent_toJava(JNIEnv* env, const AInputEvent* aInputEvent) { LOG_ALWAYS_FATAL_IF(aInputEvent == nullptr, "Expected aInputEvent to be non-null"); const int32_t eventType = AInputEvent_getType(aInputEvent); switch (eventType) { case AINPUT_EVENT_TYPE_MOTION: return android::android_view_MotionEvent_obtainAsCopy(env, static_cast<const MotionEvent&>( *aInputEvent)); case AINPUT_EVENT_TYPE_KEY: return android::android_view_KeyEvent_fromNative(env, static_cast<const KeyEvent&>( *aInputEvent)); default: LOG_ALWAYS_FATAL("Unexpected event type %d in AInputEvent_toJava.", eventType); } } void AInputQueue_attachLooper(AInputQueue* queue, ALooper* looper, int ident, ALooper_callbackFunc callback, void* data) { InputQueue* iq = static_cast<InputQueue*>(queue); Loading
native/android/libandroid.map.txt +1 −0 Original line number Diff line number Diff line Loading @@ -90,6 +90,7 @@ LIBANDROID { AInputEvent_getSource; AInputEvent_getType; AInputEvent_release; # introduced=31 AInputEvent_toJava; # introduced=35 AInputQueue_attachLooper; AInputQueue_detachLooper; AInputQueue_finishEvent; Loading