summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jiwen 'Steve' Cai <jwcai@google.com> 2018-05-07 17:08:03 -0700
committer Jiwen 'Steve' Cai <jwcai@google.com> 2018-05-07 18:08:22 -0700
commit79be892b50203ac84f207afecdbb0bd1372ab2d8 (patch)
treef80e1a2c9972edfdabbd2172a57cb47adba62860
parent84d1fb6d373c36974a7ee69b48afb7e5f2831e0d (diff)
Fix AHardwareBuffer API documentation
AHardwareBuffer_fromHardwareBuffer doesn't acquire any additional reference to the object. Update the document to reflect that. Bug: 79344864 Test: Header only change Change-Id: Ia52efb836ee917a7e0d03316afd5994e8cfb83db
-rw-r--r--include/android/hardware_buffer_jni.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/include/android/hardware_buffer_jni.h b/include/android/hardware_buffer_jni.h
index 60208701b6..7c4be24dbd 100644
--- a/include/android/hardware_buffer_jni.h
+++ b/include/android/hardware_buffer_jni.h
@@ -31,9 +31,11 @@ __BEGIN_DECLS
/**
* Return the AHardwareBuffer associated with a Java HardwareBuffer object,
- * for interacting with it through native code. This acquires a reference
- * on the AHardwareBuffer that is returned; be sure to use
- * AHardwareBuffer_release() when done with it so that it doesn't leak.
+ * for interacting with it through native code. This method does not acquire any
+ * additional reference to the AHardwareBuffer that is returned. To keep the
+ * AHardwareBuffer live after the Java HardwareBuffer object got garbage
+ * collected, be sure to use AHardwareBuffer_acquire() to acquire an additional
+ * reference.
*/
AHardwareBuffer* AHardwareBuffer_fromHardwareBuffer(JNIEnv* env,
jobject hardwareBufferObj);