Skip to content

Commit f8680e6

Browse files
author
Arpit Singh
committed
Add NDK API to obtain Java InputEvent from Native AInputEvent
This CL adds an NDK API to obtain a copy of native AInputEvent as Java InputEvent. Test: atest MotionEventTest KeyEventTest Bug: 298948992 Change-Id: If7b14867813f7b07bd628ebd6da7e3be4c3bb89e
1 parent 859749f commit f8680e6

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

include/android/input.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1490,6 +1490,14 @@ int32_t AMotionEvent_getClassification(const AInputEvent* motion_event)
14901490
*/
14911491
const AInputEvent* AMotionEvent_fromJava(JNIEnv* env, jobject motionEvent) __INTRODUCED_IN(31);
14921492

1493+
/**
1494+
* Creates a java android.view.InputEvent object that is a copy of the specified native
1495+
* {@link AInputEvent}. Returns null on error
1496+
*
1497+
* Available since API level 35.
1498+
*/
1499+
jobject AInputEvent_toJava(JNIEnv* env, const AInputEvent* aInputEvent) __INTRODUCED_IN(35);
1500+
14931501
struct AInputQueue;
14941502
/**
14951503
* Input queue

0 commit comments

Comments
 (0)