diff options
| author | zhuw <zhuw@codeaurora.org> | 2017-11-08 13:05:51 +0800 |
|---|---|---|
| committer | zhuw <zhuw@codeaurora.org> | 2017-11-08 13:14:23 +0800 |
| commit | db126f27692565bba5f45f0523df6449e1654ba2 (patch) | |
| tree | b5007cc9d4e75fec6a539674b99fe368dd5c0087 /src/com/android/camera/CaptureModule.java | |
| parent | 85076fda04296ed1ba8f41bf1f5bdb4e56716749 (diff) | |
SnapdragonCamera: Fix touch AF don't work
send request from setting only when change value manually
Change-Id: Ia2b6153e0832afc72f89d211b9d9f438c3b8632a
CRs-Fixed: 2138390
Diffstat (limited to 'src/com/android/camera/CaptureModule.java')
| -rwxr-xr-x | src/com/android/camera/CaptureModule.java | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java index 6296cdcba..5ec93ad1f 100755 --- a/src/com/android/camera/CaptureModule.java +++ b/src/com/android/camera/CaptureModule.java @@ -262,6 +262,7 @@ 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 = mControlAFMode; private int mLastResultAFState = -1; private Rect[] mCropRegion = new Rect[MAX_NUM_CAM]; private boolean mAutoFocusRegionSupported; @@ -2122,7 +2123,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); applyExposure(builder); @@ -2134,7 +2135,6 @@ public class CaptureModule implements CameraModule, PhotoController, applySaturationLevel(builder); applyAntiBandingLevel(builder); applySharpnessControlModes(builder); - applyAfModes(builder); applyExposureMeteringModes(builder); applyHistogram(builder); } @@ -4033,10 +4033,19 @@ public class CaptureModule implements CameraModule, PhotoController, private void applyAfModes(CaptureRequest.Builder request) { String value = mSettingsManager.getValue(SettingsManager.KEY_AF_MODE); + int intValue = mLastAFmode; if (value != null) { - int intValue = Integer.parseInt(value); + intValue = Integer.parseInt(value); + } + if (mLastAFmode != intValue) { + // means afmode value changed manually 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) { |
