summaryrefslogtreecommitdiffstats
path: root/services/camera
diff options
context:
space:
mode:
authorIgor Murashkin <iam@google.com>2012-10-09 13:49:28 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-10-09 13:49:28 -0700
commit3d84d38e7ac02b47d17f4bb272f18f8b0e873104 (patch)
treee63ade01c0ccd5341c38addb636fe84bef7e9236 /services/camera
parentd016cf5b12cb73bd49bcecb0d5a4958df23620c3 (diff)
parent5f0714eb039c07554bef6ec289c70ed1164fdf52 (diff)
downloadframeworks_av-3d84d38e7ac02b47d17f4bb272f18f8b0e873104.zip
frameworks_av-3d84d38e7ac02b47d17f4bb272f18f8b0e873104.tar.gz
frameworks_av-3d84d38e7ac02b47d17f4bb272f18f8b0e873104.tar.bz2
Merge "Camera2: Call onAutoFocus immediately for fixed-focus cameras" into jb-mr1-dev
Diffstat (limited to 'services/camera')
-rw-r--r--services/camera/libcameraservice/Camera2Client.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/services/camera/libcameraservice/Camera2Client.cpp b/services/camera/libcameraservice/Camera2Client.cpp
index e073e39..7a6e344 100644
--- a/services/camera/libcameraservice/Camera2Client.cpp
+++ b/services/camera/libcameraservice/Camera2Client.cpp
@@ -959,6 +959,21 @@ status_t Camera2Client::autoFocus() {
return INVALID_OPERATION;
}
+ /**
+ * If the camera does not support auto-focus, it is a no-op and
+ * onAutoFocus(boolean, Camera) callback will be called immediately
+ * with a fake value of success set to true.
+ */
+ if (l.mParameters.focusMode == Parameters::FOCUS_MODE_FIXED) {
+ SharedCameraClient::Lock l(mSharedCameraClient);
+ if (l.mCameraClient != 0) {
+ l.mCameraClient->notifyCallback(CAMERA_MSG_FOCUS,
+ /*success*/1, 0);
+ }
+
+ return OK;
+ }
+
if (l.mParameters.quirks.triggerAfWithAuto &&
l.mParameters.sceneMode != ANDROID_CONTROL_SCENE_MODE_UNSUPPORTED &&
l.mParameters.focusMode != Parameters::FOCUS_MODE_AUTO) {