diff options
author | Chih-Chung Chang <chihchung@google.com> | 2009-09-15 15:33:39 +0800 |
---|---|---|
committer | Chih-Chung Chang <chihchung@google.com> | 2009-09-15 18:32:17 +0800 |
commit | 62a2ae8a96495b77bd1d11420fd352cd0b8ca7c3 (patch) | |
tree | 9fc861c7e88cafa6507ded4ac92785b84eaaa930 /src/com/android | |
parent | 2dabc27c42bbfeb65cd1e8b5ee1248a8bf10ee0a (diff) | |
download | LegacyCamera-62a2ae8a96495b77bd1d11420fd352cd0b8ca7c3.zip LegacyCamera-62a2ae8a96495b77bd1d11420fd352cd0b8ca7c3.tar.gz LegacyCamera-62a2ae8a96495b77bd1d11420fd352cd0b8ca7c3.tar.bz2 |
Fix 2083478: Camera needs an auto-focus cancel API
Change-Id: I015c2ec5496dfd3921845f4974ba91a388675763
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/camera/Camera.java | 17 |
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(); } } } |