diff options
author | zhuw <zhuw@codeaurora.org> | 2017-11-26 17:35:56 +0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-11-26 17:54:09 -0800 |
commit | b2ee18a30f55f333d580d6b578e1c748a9facf5d (patch) | |
tree | 5a52ec5f6ffc3359ad22ec0ba4c0941280c89792 /src | |
parent | eeefe8bb8f841deb35ea7b9bbdff41685d2e818d (diff) | |
download | android_packages_apps_Snap-b2ee18a30f55f333d580d6b578e1c748a9facf5d.tar.gz android_packages_apps_Snap-b2ee18a30f55f333d580d6b578e1c748a9facf5d.tar.bz2 android_packages_apps_Snap-b2ee18a30f55f333d580d6b578e1c748a9facf5d.zip |
SnapdragonCamera: change strategy of af changing in dev option
The manually changed value will overwrite the auto changed value
But closed it when it is set to "off"
Change-Id: I1f4ee5b6a03e9f47e96e7a66ac3b111802a4017b
Diffstat (limited to 'src')
-rwxr-xr-x | src/com/android/camera/CaptureModule.java | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java index 900154cd4..1320a5579 100755 --- a/src/com/android/camera/CaptureModule.java +++ b/src/com/android/camera/CaptureModule.java @@ -262,7 +262,6 @@ public class CaptureModule implements CameraModule, PhotoController, private boolean[] mTakingPicture = new boolean[MAX_NUM_CAM]; private int mControlAFMode = CameraMetadata.CONTROL_AF_MODE_CONTINUOUS_PICTURE; - private int mLastAFmode = -1; private int mLastResultAFState = -1; private Rect[] mCropRegion = new Rect[MAX_NUM_CAM]; private boolean mAutoFocusRegionSupported; @@ -1245,10 +1244,6 @@ public class CaptureModule implements CameraModule, PhotoController, mSettingsManager = SettingsManager.getInstance(); mSettingsManager.registerListener(this); mSettingsManager.init(); - String value = mSettingsManager.getValue(SettingsManager.KEY_AF_MODE); - if (value != null) { - mLastAFmode = Integer.parseInt(value); - } mFirstPreviewLoaded = false; Log.d(TAG, "init"); for (int i = 0; i < MAX_NUM_CAM; i++) { @@ -2145,6 +2140,7 @@ public class CaptureModule implements CameraModule, PhotoController, private void applyCommonSettings(CaptureRequest.Builder builder, int id) { builder.set(CaptureRequest.CONTROL_MODE, CaptureRequest.CONTROL_MODE_AUTO); + builder.set(CaptureRequest.CONTROL_AF_MODE, mControlAFMode); applyAfModes(builder); applyFaceDetection(builder); applyWhiteBalance(builder); @@ -4071,19 +4067,14 @@ public class CaptureModule implements CameraModule, PhotoController, private void applyAfModes(CaptureRequest.Builder request) { String value = mSettingsManager.getValue(SettingsManager.KEY_AF_MODE); - int intValue = mLastAFmode; + int intValue = -1; if (value != null) { intValue = Integer.parseInt(value); } - if (mLastAFmode != intValue && -1 != mLastAFmode) { - // means afmode value changed manually + if (intValue != CaptureRequest.CONTROL_AF_MODE_OFF + && intValue != -1) { request.set(CaptureRequest.CONTROL_AF_MODE, intValue); - mControlAFMode = intValue; - } else { - request.set(CaptureRequest.CONTROL_AF_MODE, mControlAFMode); - mSettingsManager.setValue(SettingsManager.KEY_AF_MODE, String.valueOf(mControlAFMode)); } - mLastAFmode = mControlAFMode; } private void applyExposureMeteringModes(CaptureRequest.Builder request) { |