camera2: Update native<->managed camera metadata marshalers
* Improve existing marshalers:
- each managed/native type combination can be queried marshal support
- marshalers can recursively call other marshalers for nested types
- support marshaling/unmarshaling generic classes by using super type tokens
* Add new marshalers for:
- ColorSpaceTransform
- MeteringRectangle
- Parcelable
- Range<T>
- ReprocessFormatsMap
- RggbChannelVector
- SizeF
- StreamConfiguration
- StreamConfigurationDuration
Batteries included; so are unit tests.
Bug: 14628001
Change-Id: I38d3e646ccfb3953898cd6f750c33e4097328482
diff --git a/core/jni/android_hardware_camera2_CameraMetadata.cpp b/core/jni/android_hardware_camera2_CameraMetadata.cpp
index 05a99a3..fa2cfe3 100644
--- a/core/jni/android_hardware_camera2_CameraMetadata.cpp
+++ b/core/jni/android_hardware_camera2_CameraMetadata.cpp
@@ -489,8 +489,13 @@
sp<VendorTagDescriptor> vTags = VendorTagDescriptor::getGlobalVendorTagDescriptor();
- SortedVector<String8> vendorSections = vTags->getAllSectionNames();
- size_t vendorSectionCount = vendorSections.size();
+ SortedVector<String8> vendorSections;
+ size_t vendorSectionCount = 0;
+
+ if (vTags != 0) {
+ vendorSections = vTags->getAllSectionNames();
+ vendorSectionCount = vendorSections.size();
+ }
// First, find the section by the longest string match
const char *section = NULL;
@@ -561,7 +566,7 @@
"Could not find tag name for key '%s')", key);
return 0;
}
- } else {
+ } else if (vTags != 0) {
// Match vendor tags (typically com.*)
const String8 sectionName(section);
const String8 tagName(keyTagName);