summaryrefslogtreecommitdiffstats
path: root/services/camera
diff options
context:
space:
mode:
authorYin-Chia Yeh <yinchiayeh@google.com>2014-08-14 14:24:24 -0700
committerYin-Chia Yeh <yinchiayeh@google.com>2014-08-14 15:32:19 -0700
commit80ef94b5a7daa2d48ca72501e335a648dc67bc1d (patch)
tree59c9b2814abc12506ffa849e5082c33065bd8630 /services/camera
parent47bf8d8f0242bbe9cfa777c96e41e5fcd5294ee4 (diff)
downloadframeworks_av-80ef94b5a7daa2d48ca72501e335a648dc67bc1d.zip
frameworks_av-80ef94b5a7daa2d48ca72501e335a648dc67bc1d.tar.gz
frameworks_av-80ef94b5a7daa2d48ca72501e335a648dc67bc1d.tar.bz2
cameraservice: update supportedFocusModes for api1
Do not list infinity focus mode if the focuser is not calibrated. bug 13933979 Change-Id: I677ed22305703ac09eeaf986f5bc2a680cececd8
Diffstat (limited to 'services/camera')
-rw-r--r--services/camera/libcameraservice/api1/client2/Parameters.cpp13
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 30a6c7b..22f04b7 100644
--- a/services/camera/libcameraservice/api1/client2/Parameters.cpp
+++ b/services/camera/libcameraservice/api1/client2/Parameters.cpp
@@ -640,8 +640,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 += ",";