From 6eed2ca62fbaeb5b3e9684ade3d1dfb29f6f295b Mon Sep 17 00:00:00 2001 From: Rajshekar Eashwarappa Date: Wed, 12 Dec 2018 19:07:00 +0530 Subject: SnapdragonCamera: Check for fixed focus 1. Check whether the lens is fixed focus or variable focus 2. If the lens is fixed focus then just check for AE state and trigger snapshot, as AF state will always be 0 for fixed focus lens 3. For varialbe focus lenses check for both AF & AE state before trigger of Snapshot. Change-Id: Iafeae46bd4283d336e4686be0a055cf31297c8c5 --- src/com/android/camera/CaptureModule.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java index 3a69a03c5..a55c9e451 100755 --- a/src/com/android/camera/CaptureModule.java +++ b/src/com/android/camera/CaptureModule.java @@ -1037,7 +1037,14 @@ public class CaptureModule implements CameraModule, PhotoController, } } - if ((CaptureResult.CONTROL_AF_STATE_FOCUSED_LOCKED == afState || + // If the lens is just fixed focus then check only + // for AE Lock else check AF & AE state before + // trigger of capture + if (mSettingsManager.isFixedFocus(getMainCameraId())) { + if (aeState == null || aeState == CaptureResult.CONTROL_AE_STATE_LOCKED) { + checkAfAeStatesAndCapture(id); + } + } else if ((CaptureResult.CONTROL_AF_STATE_FOCUSED_LOCKED == afState || CaptureResult.CONTROL_AF_STATE_NOT_FOCUSED_LOCKED == afState) && (aeState == null || aeState == CaptureResult.CONTROL_AE_STATE_LOCKED)) { checkAfAeStatesAndCapture(id); -- cgit v1.2.3