summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/Camera.java
diff options
context:
space:
mode:
authorWu-cheng Li <wuchengli@google.com>2011-11-10 16:06:17 +0800
committerWu-cheng Li <wuchengli@google.com>2011-11-10 17:01:33 +0800
commit72eaced345def3746038f1aba3efe2845b274884 (patch)
treea6031097bf41ca8d9ca2fbb4fc6958dba71d9110 /src/com/android/camera/Camera.java
parent8252bf716c798a1007e7869569b35815d2df3c6c (diff)
downloadLegacyCamera-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/com/android/camera/Camera.java')
-rw-r--r--src/com/android/camera/Camera.java20
1 files changed, 12 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) {