From e22541d5f35155302b1a8bec705c48065155f3a9 Mon Sep 17 00:00:00 2001 From: Mattia Iavarone Date: Sun, 1 Sep 2019 19:49:21 +0200 Subject: [PATCH] Improve locking/AutoFocus --- .../otaliastudios/cameraview/engine/locking/AutoFocus.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cameraview/src/main/java/com/otaliastudios/cameraview/engine/locking/AutoFocus.java b/cameraview/src/main/java/com/otaliastudios/cameraview/engine/locking/AutoFocus.java index ac727f62..1e4bda45 100644 --- a/cameraview/src/main/java/com/otaliastudios/cameraview/engine/locking/AutoFocus.java +++ b/cameraview/src/main/java/com/otaliastudios/cameraview/engine/locking/AutoFocus.java @@ -39,8 +39,11 @@ public class AutoFocus extends Parameter { protected boolean checkShouldSkip(@NonNull CaptureResult lastResult) { Integer afState = lastResult.get(CaptureResult.CONTROL_AF_STATE); boolean afStateOk = afState != null && - (afState == CaptureResult.CONTROL_AF_STATE_FOCUSED_LOCKED || - afState == CaptureResult.CONTROL_AF_STATE_NOT_FOCUSED_LOCKED); + (afState == CaptureResult.CONTROL_AF_STATE_FOCUSED_LOCKED + || afState == CaptureResult.CONTROL_AF_STATE_NOT_FOCUSED_LOCKED + || afState == CaptureResult.CONTROL_AF_STATE_INACTIVE + || afState == CaptureResult.CONTROL_AF_STATE_PASSIVE_FOCUSED + || afState == CaptureResult.CONTROL_AF_STATE_PASSIVE_UNFOCUSED); Integer afMode = lastResult.get(CaptureResult.CONTROL_AF_MODE); boolean afModeOk = afMode != null && afMode == CaptureResult.CONTROL_AF_MODE_AUTO; boolean result = afStateOk && afModeOk;