diff options
author | Wu-cheng Li <wuchengli@google.com> | 2011-11-10 16:06:17 +0800 |
---|---|---|
committer | Wu-cheng Li <wuchengli@google.com> | 2011-11-10 17:01:33 +0800 |
commit | 72eaced345def3746038f1aba3efe2845b274884 (patch) | |
tree | a6031097bf41ca8d9ca2fbb4fc6958dba71d9110 /src | |
parent | 8252bf716c798a1007e7869569b35815d2df3c6c (diff) | |
download | LegacyCamera-72eaced345def3746038f1aba3efe2845b274884.zip LegacyCamera-72eaced345def3746038f1aba3efe2845b274884.tar.gz LegacyCamera-72eaced345def3746038f1aba3efe2845b274884.tar.bz2 |
Do not reset the focus if next snapshot is pending.
+ Suupose autofocus is focusing and a picture will be taken when
focus callback arrives. Remeber the next snapshot request if
the shutter button is clicked.
bug:5589632
Change-Id: Ice8df7145f68996bd307fa5914e1c672bc624239
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/camera/Camera.java | 20 | ||||
-rw-r--r-- | src/com/android/camera/FocusManager.java | 4 |
2 files changed, 16 insertions, 8 deletions
diff --git a/src/com/android/camera/Camera.java b/src/com/android/camera/Camera.java index 1fad8a8..ff98f4a 100644 --- a/src/com/android/camera/Camera.java +++ b/src/com/android/camera/Camera.java @@ -1402,8 +1402,10 @@ public class Camera extends ActivityBase implements FocusManager.Listener, // If the user wants to do a snapshot while the previous one is still // in progress, remember the fact and do it after we finish the previous - // one and re-start the preview. - if (mCameraState == SNAPSHOT_IN_PROGRESS) { + // one and re-start the preview. Snapshot in progress also includes the + // state that autofocus is focusing and a picture will be taken when + // focus callback arrives. + if (mFocusManager.isFocusingSnapOnFinish() || mCameraState == SNAPSHOT_IN_PROGRESS) { mSnapshotOnIdle = true; return; } @@ -1765,13 +1767,15 @@ public class Camera extends ActivityBase implements FocusManager.Listener, setPreviewDisplay(mSurfaceHolder); setDisplayOrientation(); - mFocusManager.setAeAwbLock(false); // Unlock AE and AWB. - 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(); + if (!mSnapshotOnIdle) { + // 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(mFocusManager.getFocusMode())) { + mCameraDevice.cancelAutoFocus(); + } + mFocusManager.setAeAwbLock(false); // Unlock AE and AWB. } + setCameraParameters(UPDATE_PARAM_ALL); // Inform the mainthread to go on the UI initialization. if (mCameraPreviewThread != null) { diff --git a/src/com/android/camera/FocusManager.java b/src/com/android/camera/FocusManager.java index bdf4766..76a8737 100644 --- a/src/com/android/camera/FocusManager.java +++ b/src/com/android/camera/FocusManager.java @@ -471,6 +471,10 @@ public class FocusManager { return mState == STATE_SUCCESS || mState == STATE_FAIL; } + public boolean isFocusingSnapOnFinish() { + return mState == STATE_FOCUSING_SNAP_ON_FINISH; + } + public void removeMessages() { mHandler.removeMessages(RESET_TOUCH_FOCUS); } |