summaryrefslogtreecommitdiffstats
path: root/services/camera/libcameraservice
diff options
context:
space:
mode:
Diffstat (limited to 'services/camera/libcameraservice')
-rw-r--r--services/camera/libcameraservice/common/CameraModule.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/services/camera/libcameraservice/common/CameraModule.cpp b/services/camera/libcameraservice/common/CameraModule.cpp
index e5b12ae..b861d71 100644
--- a/services/camera/libcameraservice/common/CameraModule.cpp
+++ b/services/camera/libcameraservice/common/CameraModule.cpp
@@ -78,6 +78,12 @@ int CameraModule::getCameraInfo(int cameraId, struct camera_info *info) {
if (ret != 0) {
return ret;
}
+ int deviceVersion = cameraInfo.device_version;
+ if (deviceVersion < CAMERA_DEVICE_API_VERSION_2_0) {
+ // static_camera_characteristics is invalid
+ *info = rawInfo;
+ return ret;
+ }
CameraMetadata m;
m = rawInfo.static_camera_characteristics;
deriveCameraCharacteristicsKeys(rawInfo.device_version, m);