From 1a2d5703592ff824c4aee30253b4923d38061143 Mon Sep 17 00:00:00 2001 From: zhuw Date: Tue, 22 Jan 2019 18:28:00 +0800 Subject: fix Macro Auto Focus mode is not working APP will trigger TAF with one request. Then repeating with AUTO mode no matter which option is selected But APP will repeating selected af mode after 5sec later(time out). Change-Id: Ibbd8ccef54d87421d9aacfacefc0e07fa506843c CRs-Fixed:2379642 --- src/com/android/camera/CaptureModule.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/com/android/camera/CaptureModule.java') diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java index ca445801a..690b93f90 100755 --- a/src/com/android/camera/CaptureModule.java +++ b/src/com/android/camera/CaptureModule.java @@ -1735,8 +1735,6 @@ public class CaptureModule implements CameraModule, PhotoController, if (!checkSessionAndBuilder(mCaptureSession[id], mPreviewRequestBuilder[id])) { return; } - afMode = (mSettingsManager.isDeveloperEnabled() && getDevAfMode() != -1) ? getDevAfMode() - : afMode; if (DEBUG) { Log.d(TAG, "setAFModeToPreview " + afMode); } @@ -2898,8 +2896,10 @@ public class CaptureModule implements CameraModule, PhotoController, if (mSettingsManager.isDeveloperEnabled()) { applyCommonSettings(mPreviewRequestBuilder[id], id); } + int afMode = (mSettingsManager.isDeveloperEnabled() && getDevAfMode() != -1) ? + getDevAfMode() : mControlAFMode; setAFModeToPreview(id, mUI.getCurrentProMode() == ProMode.MANUAL_MODE ? - CaptureRequest.CONTROL_AF_MODE_OFF : mControlAFMode); + CaptureRequest.CONTROL_AF_MODE_OFF : afMode); mTakingPicture[id] = false; enableShutterAndVideoOnUiThread(id); } catch (NullPointerException | IllegalStateException | CameraAccessException e) { @@ -6673,7 +6673,8 @@ public class CaptureModule implements CameraModule, PhotoController, mState[id] = STATE_PREVIEW; mControlAFMode = CaptureRequest.CONTROL_AF_MODE_CONTINUOUS_PICTURE; mIsAutoFocusStarted = false; - setAFModeToPreview(id, mControlAFMode); + setAFModeToPreview(id, (mSettingsManager.isDeveloperEnabled() && getDevAfMode() != -1) ? + getDevAfMode() : mControlAFMode); } private MeteringRectangle[] afaeRectangle(float x, float y, int width, int height, -- cgit v1.2.3