diff options
author | Wu-cheng Li <wuchengli@google.com> | 2011-09-26 18:15:20 +0800 |
---|---|---|
committer | Wu-cheng Li <wuchengli@google.com> | 2011-09-26 18:35:02 +0800 |
commit | 3c454fc97678e8967cbc6c8a4a67097c5bdb2422 (patch) | |
tree | d114c65d5e045b6fc64be097c613251ee4962932 /src/com | |
parent | bb8faa4a072bc3b5af93ab080dc1511dd734d32f (diff) | |
download | LegacyCamera-3c454fc97678e8967cbc6c8a4a67097c5bdb2422.zip LegacyCamera-3c454fc97678e8967cbc6c8a4a67097c5bdb2422.tar.gz LegacyCamera-3c454fc97678e8967cbc6c8a4a67097c5bdb2422.tar.bz2 |
Call cancelAutoFocus in startPreview and before release.
Now camera API specifies focus it not reset by stopPreview or
takePicture. This is especially important when the mode is
FOCUS_MODE_CONTINUOUS_PICTURE because the focus will be paused
after autoFocus is called.
bug:5356404
Change-Id: I027df2b8b4092183668c21f4d97a84ad73a9d396
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/camera/Camera.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/com/android/camera/Camera.java b/src/com/android/camera/Camera.java index ed8ef5e..4c576a5 100644 --- a/src/com/android/camera/Camera.java +++ b/src/com/android/camera/Camera.java @@ -1489,6 +1489,7 @@ public class Camera extends ActivityBase implements FocusManager.Listener, private void closeCamera() { if (mCameraDevice != null) { + mCameraDevice.cancelAutoFocus(); // Reset the focus. CameraHolder.instance().release(); mCameraDevice.setZoomChangeListener(null); mCameraDevice.setFaceDetectionListener(null); @@ -1528,6 +1529,11 @@ public class Camera extends ActivityBase implements FocusManager.Listener, } mAeAwbLock = false; // Always unlock AE and AWB before start. setCameraParameters(UPDATE_PARAM_ALL); + // If the focus mode is continuous autofocus, call cancelAutoFocus to + // resume it because it may have been paused by autoFocus call. + if (Parameters.FOCUS_MODE_CONTINUOUS_PICTURE.equals(mParameters.getFocusMode())) { + mCameraDevice.cancelAutoFocus(); + } try { Log.v(TAG, "startPreview"); |