diff options
author | Yin-Chia Yeh <yinchiayeh@google.com> | 2014-08-19 15:45:13 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-08-19 02:08:36 +0000 |
commit | 97c7fa1b1596a062147f034a2b44781193c052cf (patch) | |
tree | 14d2e49123e41b3d5053532fa9278ca32068813a /services/camera/libcameraservice | |
parent | 1b786a35ddd072765348eee2bffa2009c1b14da3 (diff) | |
parent | 80ef94b5a7daa2d48ca72501e335a648dc67bc1d (diff) | |
download | frameworks_av-97c7fa1b1596a062147f034a2b44781193c052cf.zip frameworks_av-97c7fa1b1596a062147f034a2b44781193c052cf.tar.gz frameworks_av-97c7fa1b1596a062147f034a2b44781193c052cf.tar.bz2 |
Merge "cameraservice: update supportedFocusModes for api1" into lmp-dev
Diffstat (limited to 'services/camera/libcameraservice')
-rw-r--r-- | services/camera/libcameraservice/api1/client2/Parameters.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/services/camera/libcameraservice/api1/client2/Parameters.cpp b/services/camera/libcameraservice/api1/client2/Parameters.cpp index b448e06..e7f9a78 100644 --- a/services/camera/libcameraservice/api1/client2/Parameters.cpp +++ b/services/camera/libcameraservice/api1/client2/Parameters.cpp @@ -644,8 +644,17 @@ status_t Parameters::initialize(const CameraMetadata *info, int deviceVersion) { focusMode = Parameters::FOCUS_MODE_AUTO; params.set(CameraParameters::KEY_FOCUS_MODE, CameraParameters::FOCUS_MODE_AUTO); - String8 supportedFocusModes(CameraParameters::FOCUS_MODE_INFINITY); - bool addComma = true; + String8 supportedFocusModes; + bool addComma = false; + camera_metadata_ro_entry_t focusDistanceCalibration = + staticInfo(ANDROID_LENS_INFO_FOCUS_DISTANCE_CALIBRATION, 0, 0, false); + + if (focusDistanceCalibration.count && + focusDistanceCalibration.data.u8[0] != + ANDROID_LENS_INFO_FOCUS_DISTANCE_CALIBRATION_UNCALIBRATED) { + supportedFocusModes += CameraParameters::FOCUS_MODE_INFINITY; + addComma = true; + } for (size_t i=0; i < availableAfModes.count; i++) { if (addComma) supportedFocusModes += ","; |