diff options
author | Wu-cheng Li <wuchengli@google.com> | 2011-09-22 00:59:17 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-09-22 00:59:17 -0700 |
commit | 0f98da00b21484d147add25cb3f1ddbf924ad70e (patch) | |
tree | 97663286aff0828be432718ada051a319d7674b1 /src/com | |
parent | c9b05bf45bdefe34c2d5591fef3224dd2049461c (diff) | |
parent | d5b2118fc4aa377a3c4f5e4052745f14ec78b2c4 (diff) | |
download | LegacyCamera-0f98da00b21484d147add25cb3f1ddbf924ad70e.zip LegacyCamera-0f98da00b21484d147add25cb3f1ddbf924ad70e.tar.gz LegacyCamera-0f98da00b21484d147add25cb3f1ddbf924ad70e.tar.bz2 |
Merge "Lock AE and AWB before autofocus starts." into ics-factoryrom
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/camera/Camera.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/com/android/camera/Camera.java b/src/com/android/camera/Camera.java index 26d4497..970d98e 100644 --- a/src/com/android/camera/Camera.java +++ b/src/com/android/camera/Camera.java @@ -120,6 +120,9 @@ public class Camera extends ActivityBase implements FocusManager.Listener, private Parameters mInitialParams; private boolean mFocusAreaSupported; private boolean mMeteringAreaSupported; + private boolean mAwbLockSupported; + private boolean mAeLockSupported; + private boolean mAeAwbLock; private MyOrientationEventListener mOrientationListener; // The degrees of the device rotated clockwise from its natural orientation. @@ -1417,6 +1420,9 @@ public class Camera extends ActivityBase implements FocusManager.Listener, // Do not do focus if there is not enough storage. if (pressed && !canTakePicture()) return; + // Lock AE and AWB so users can half-press shutter and recompose. + mAeAwbLock = pressed; + setCameraParameters(UPDATE_PARAM_PREFERENCE); mFocusManager.doFocus(pressed); } @@ -1519,6 +1525,7 @@ public class Camera extends ActivityBase implements FocusManager.Listener, if (mFaceView != null) { mFaceView.setDisplayOrientation(mDisplayOrientation); } + mAeAwbLock = false; // Always unlock AE and AWB before start. setCameraParameters(UPDATE_PARAM_ALL); try { @@ -1568,6 +1575,14 @@ public class Camera extends ActivityBase implements FocusManager.Listener, } private void updateCameraParametersPreference() { + if (mAwbLockSupported) { + mParameters.setAutoWhiteBalanceLock(mAeAwbLock); + } + + if (mAeLockSupported) { + mParameters.setAutoExposureLock(mAeAwbLock); + } + if (mFocusAreaSupported) { mParameters.setFocusAreas(mFocusManager.getTapArea()); } @@ -1972,5 +1987,7 @@ public class Camera extends ActivityBase implements FocusManager.Listener, && isSupported(Parameters.FOCUS_MODE_AUTO, mInitialParams.getSupportedFocusModes())); mMeteringAreaSupported = (mInitialParams.getMaxNumMeteringAreas() > 0); + mAwbLockSupported = mInitialParams.isAutoWhiteBalanceLockSupported(); + mAeLockSupported = mInitialParams.isAutoExposureLockSupported(); } } |