cameraservice_test: Add ZoomRatioTest to the host build.
ZoomRatioTest requires getArrayWidthAndHeight, which has been added in
this patch to SessionConfigurationUtilsHost.cpp.
Bug: 207411352
Test: Ran test on gLinux.
Change-Id: Ie1cd954cc49ab0f3bb80bd2fbe82397689c25dd2
diff --git a/services/camera/libcameraservice/utils/SessionConfigurationUtilsHost.cpp b/services/camera/libcameraservice/utils/SessionConfigurationUtilsHost.cpp
index 06a7d23..1efdc60 100644
--- a/services/camera/libcameraservice/utils/SessionConfigurationUtilsHost.cpp
+++ b/services/camera/libcameraservice/utils/SessionConfigurationUtilsHost.cpp
@@ -77,6 +77,20 @@
return false;
}
+bool getArrayWidthAndHeight(const CameraMetadata *deviceInfo,
+ int32_t arrayTag, int32_t *width, int32_t *height) {
+ if (width == nullptr || height == nullptr) {
+ ALOGE("%s: width / height nullptr", __FUNCTION__);
+ return false;
+ }
+ camera_metadata_ro_entry_t entry;
+ entry = deviceInfo->find(arrayTag);
+ if (entry.count != 4) return false;
+ *width = entry.data.i32[2];
+ *height = entry.data.i32[3];
+ return true;
+}
+
} // namespace SessionConfigurationUtils
} // namespace camera3
} // namespace android
\ No newline at end of file