From 9d43974f4d7110552d5ca39d0a8576b8c87fdb6f Mon Sep 17 00:00:00 2001 From: Prabir Pradhan Date: Thu, 16 Dec 2021 03:32:30 -0800 Subject: Add lifecycle information to docs for AInputQueue_fromJava Add documentation to AInputQueue_fromJava to make it explicit that the returned native object is only valid as long as the java object has not yet been disposed. Test: None Bug: 210727408 Change-Id: I20ec68afba0ec79477d57b8a110d55220b7c01ff --- include/android/input.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'include/android/input.h') diff --git a/include/android/input.h b/include/android/input.h index 447f8fa842..fbd61b53f4 100644 --- a/include/android/input.h +++ b/include/android/input.h @@ -1386,8 +1386,11 @@ int32_t AInputQueue_preDispatchEvent(AInputQueue* queue, AInputEvent* event); void AInputQueue_finishEvent(AInputQueue* queue, AInputEvent* event, int handled); /** - * Supplies the AInputQueue* object associated with the supplied Java InputQueue - * object. + * Returns the AInputQueue* object associated with the supplied Java InputQueue + * object. The returned native object holds a weak reference to the Java object, + * and is only valid as long as the Java object has not yet been disposed. You + * should ensure that there is a strong reference to the Java object and that it + * has not been disposed before using the returned object. * * Available since API level 33. */ -- cgit v1.2.3-59-g8ed1b