From c91c644ce06e5fbff08b1bb4866ce1bd81e85b7b Mon Sep 17 00:00:00 2001 From: Arpit Singh Date: Fri, 16 Feb 2024 11:42:38 +0000 Subject: Update documentation for AInputEvent_toJava As AInputEvent_toJava makes JNI calls, the caller must ensure there are no pending JNI exceptions as it may result in undefined behaviour. This needs to be explicitly documented. Refer: https://developer.android.com/training/articles/perf-jni#exceptions Bug: 324375527 Test: atest MotionEventTest KeyEventTest Change-Id: If9f40ba1ee2cb091514fb3baae28f2ca7520727e --- include/android/input.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include/android') diff --git a/include/android/input.h b/include/android/input.h index b5c1e5c354..fec56f02f9 100644 --- a/include/android/input.h +++ b/include/android/input.h @@ -1492,7 +1492,10 @@ const AInputEvent* AMotionEvent_fromJava(JNIEnv* env, jobject motionEvent) __INT /** * Creates a java android.view.InputEvent object that is a copy of the specified native - * {@link AInputEvent}. Returns null on error + * {@link AInputEvent}. + * + * Specified {@link AInputEvent} is require to be a valid {@link MotionEvent} or {@link KeyEvent} + * object. * * Available since API level 35. */ -- cgit v1.2.3-59-g8ed1b