summaryrefslogtreecommitdiffstats
path: root/src/com/android
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android')
-rw-r--r--src/com/android/camera/Camera.java17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/com/android/camera/Camera.java b/src/com/android/camera/Camera.java
index 1549c74..0a9812e 100644
--- a/src/com/android/camera/Camera.java
+++ b/src/com/android/camera/Camera.java
@@ -1262,6 +1262,18 @@ public class Camera extends Activity implements View.OnClickListener,
}
}
+ private void cancelAutoFocus() {
+ // User releases half-pressed focus key.
+ if (mFocusState == FOCUSING || mFocusState == FOCUS_SUCCESS
+ || mFocusState == FOCUS_FAIL) {
+ Log.v(TAG, "Cancel autofocus.");
+ mCameraDevice.cancelAutoFocus();
+ }
+ if (mFocusState != FOCUSING_SNAP_ON_FINISH) {
+ clearFocusState();
+ }
+ }
+
private void clearFocusState() {
mFocusState = FOCUS_NOT_STARTED;
updateFocusIndicator();
@@ -1363,10 +1375,7 @@ public class Camera extends Activity implements View.OnClickListener,
if (pressed) { // Focus key down.
autoFocus();
} else { // Focus key up.
- if (mFocusState != FOCUSING_SNAP_ON_FINISH) {
- // User releases half-pressed focus key.
- clearFocusState();
- }
+ cancelAutoFocus();
}
}
}