diff options
author | Igor Murashkin <iam@google.com> | 2012-10-08 18:05:12 -0700 |
---|---|---|
committer | Igor Murashkin <iam@google.com> | 2012-10-09 11:04:10 -0700 |
commit | 5f0714eb039c07554bef6ec289c70ed1164fdf52 (patch) | |
tree | 6b40869601ba709a38869b68aca0c394a98ce037 /services/camera | |
parent | 2458d482c4822c6f9e6274f5bd12b6aea095a9cd (diff) | |
download | frameworks_av-5f0714eb039c07554bef6ec289c70ed1164fdf52.zip frameworks_av-5f0714eb039c07554bef6ec289c70ed1164fdf52.tar.gz frameworks_av-5f0714eb039c07554bef6ec289c70ed1164fdf52.tar.bz2 |
Camera2: Call onAutoFocus immediately for fixed-focus cameras
Bug: 7311578
Change-Id: Ib8a8ea1f5fc269abdd24ed1e0370dc9b87b284ee
Diffstat (limited to 'services/camera')
-rw-r--r-- | services/camera/libcameraservice/Camera2Client.cpp | 15 |
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) { |