summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorEino-Ville Talvala <etalvala@google.com>2013-06-04 16:17:17 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-06-04 16:17:17 +0000
commit8f908c0c211f8051f339bc85b01a6450f0dfd7d0 (patch)
tree4d7c2994036a50e84781ce2fbc8d494ca990e25a /services
parent25b5617c56488fe5413473ffae6b43f6c5bddc96 (diff)
parent9454a9710b13c7d9262fe1cbd910235a3cd35f20 (diff)
downloadframeworks_av-8f908c0c211f8051f339bc85b01a6450f0dfd7d0.zip
frameworks_av-8f908c0c211f8051f339bc85b01a6450f0dfd7d0.tar.gz
frameworks_av-8f908c0c211f8051f339bc85b01a6450f0dfd7d0.tar.bz2
Merge "Camera2/3: Don't trigger AF when in INFINITY focus mode." into jb-mr2-dev
Diffstat (limited to 'services')
-rw-r--r--services/camera/libcameraservice/Camera2Client.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/services/camera/libcameraservice/Camera2Client.cpp b/services/camera/libcameraservice/Camera2Client.cpp
index dd50e3c..5fdec34 100644
--- a/services/camera/libcameraservice/Camera2Client.cpp
+++ b/services/camera/libcameraservice/Camera2Client.cpp
@@ -1007,8 +1007,12 @@ status_t Camera2Client::autoFocus() {
* 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.
+ *
+ * Similarly, if focus mode is set to INFINITY, there's no reason to
+ * bother the HAL.
*/
- if (l.mParameters.focusMode == Parameters::FOCUS_MODE_FIXED) {
+ if (l.mParameters.focusMode == Parameters::FOCUS_MODE_FIXED ||
+ l.mParameters.focusMode == Parameters::FOCUS_MODE_INFINITY) {
notifyImmediately = true;
notifySuccess = true;
}
@@ -1068,6 +1072,11 @@ status_t Camera2Client::cancelAutoFocus() {
int triggerId;
{
SharedParameters::Lock l(mParameters);
+ // Canceling does nothing in FIXED or INFINITY modes
+ if (l.mParameters.focusMode == Parameters::FOCUS_MODE_FIXED ||
+ l.mParameters.focusMode == Parameters::FOCUS_MODE_INFINITY) {
+ return OK;
+ }
triggerId = ++l.mParameters.afTriggerCounter;
// When using triggerAfWithAuto quirk, may need to reset focus mode to