summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xlibcamera/SecCameraHWInterface.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/libcamera/SecCameraHWInterface.cpp b/libcamera/SecCameraHWInterface.cpp
index 5907f34..ab60bd2 100755
--- a/libcamera/SecCameraHWInterface.cpp
+++ b/libcamera/SecCameraHWInterface.cpp
@@ -898,6 +898,11 @@ status_t CameraHardwareSec::cancelAutoFocus()
{
ALOGV("%s :", __func__);
+ // If preview is not running, cancel autofocus can still be called.
+ // Since the camera subsystem is completely reset on preview start,
+ // cancel AF is a no-op.
+ if (!mPreviewRunning) return NO_ERROR;
+
// cancelAutoFocus should be allowed after preview is started. But if
// the preview is deferred, cancelAutoFocus will fail. Ignore it if that is
// the case.