CameraNDK: fill in more NDK API documents
This change adds document for ACaptureRequest, ACameraMetadata,
AImage and AImageReader.
Bug: 27102995
Change-Id: I79d88f73258c01ebeabcd5b4e3b90996759cb021
diff --git a/camera/ndk/impl/ACameraMetadata.h b/camera/ndk/impl/ACameraMetadata.h
index ab651a1..8d050c4 100644
--- a/camera/ndk/impl/ACameraMetadata.h
+++ b/camera/ndk/impl/ACameraMetadata.h
@@ -79,9 +79,15 @@
Mutex::Autolock _l(mLock);
- // Here we have to use reinterpret_cast because the NDK data type is
- // exact copy of internal data type but they do not inherit from each other
- status_t ret = mData.update(tag, reinterpret_cast<const INTERNAL_T*>(data), count);
+ status_t ret = OK;
+ if (count == 0 && data == nullptr) {
+ ret = mData.erase(tag);
+ } else {
+ // Here we have to use reinterpret_cast because the NDK data type is
+ // exact copy of internal data type but they do not inherit from each other
+ ret = mData.update(tag, reinterpret_cast<const INTERNAL_T*>(data), count);
+ }
+
if (ret == OK) {
mTags.clear();
return ACAMERA_OK;