diff options
author | 2020-08-13 23:59:50 -0500 | |
---|---|---|
committer | 2020-08-21 09:47:43 -0500 | |
commit | a53d86530d59a4ec708d4090821da21f380dd07e (patch) | |
tree | 162595e37478dcc0d0e2c0d88dc5f05947457616 /include/android/input.h | |
parent | 8d143381b1f3922c26c8d8d4195cfcc27d2345f1 (diff) |
Correct docs about the returned native objects
The native objects returned by the function are actually copies of the
Java objects. So, they do not have any relationship with the original
Java objects, and their lifetimes do not depend on them.
Bug: 150954805
Test: none
Change-Id: I21c35bf34eb10d2ce7b4716b886840b11b0c08de
Diffstat (limited to 'include/android/input.h')
-rw-r--r-- | include/android/input.h | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/include/android/input.h b/include/android/input.h index 7c392348b7..b04775b5c3 100644 --- a/include/android/input.h +++ b/include/android/input.h @@ -988,11 +988,9 @@ int64_t AKeyEvent_getDownTime(const AInputEvent* key_event); int64_t AKeyEvent_getEventTime(const AInputEvent* key_event); /** - * Creates a native AInputEvent* object associated with the specified Java android.view.KeyEvent. - * The result may be used with generic and KeyEvent-specific AInputEvent_* functions. - * The object returned by this function must be disposed using {@link AInputEvent_release()}. - * User must guarantee that lifetime for object referenced by keyEvent is prolongated - * up to release of returned AInputEvent*. + * Creates a native AInputEvent* object that is a copy of the specified Java android.view.KeyEvent. + * The result may be used with generic and KeyEvent-specific AInputEvent_* functions. The object + * returned by this function must be disposed using {@link AInputEvent_release()}. */ const AInputEvent* AKeyEvent_fromJava(JNIEnv* env, jobject keyEvent); @@ -1312,11 +1310,10 @@ float AMotionEvent_getHistoricalAxisValue(const AInputEvent* motion_event, int32_t axis, size_t pointer_index, size_t history_index); /** - * Creates a native AInputEvent* object associated with the specified Java android.view.MotionEvent. - * The result may be used with generic and MotionEvent-specific AInputEvent_* functions. - * The object returned by this function must be disposed using {@link AInputEvent_release()}. - * User must guarantee that object referenced by motionEvent won't be recycled and - * its lifetime is prolongated up to release of returned AInputEvent*. + * Creates a native AInputEvent* object that is a copy of the specified Java + * android.view.MotionEvent. The result may be used with generic and MotionEvent-specific + * AInputEvent_* functions. The object returned by this function must be disposed using + * {@link AInputEvent_release()}. */ const AInputEvent* AMotionEvent_fromJava(JNIEnv* env, jobject motionEvent); |