summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWu-cheng Li <wuchengli@google.com>2011-11-10 20:56:31 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-11-10 20:56:31 -0800
commit450396c1c56565c8b9ec1ccafbdd36de2d6ce313 (patch)
tree211bb1fab0d0e60997a324882cd86d3d55650994 /src
parent98e6bf1e8609b29dcded1cd54b49d08583836555 (diff)
parent72eaced345def3746038f1aba3efe2845b274884 (diff)
downloadLegacyCamera-450396c1c56565c8b9ec1ccafbdd36de2d6ce313.zip
LegacyCamera-450396c1c56565c8b9ec1ccafbdd36de2d6ce313.tar.gz
LegacyCamera-450396c1c56565c8b9ec1ccafbdd36de2d6ce313.tar.bz2
Merge "Do not reset the focus if next snapshot is pending." into ics-mr1
Diffstat (limited to 'src')
-rw-r--r--src/com/android/camera/Camera.java20
-rw-r--r--src/com/android/camera/FocusManager.java4
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);
}