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 875fbcd..6e9ff8b 100755
--- a/libcamera/SecCameraHWInterface.cpp
+++ b/libcamera/SecCameraHWInterface.cpp
@@ -908,6 +908,11 @@ status_t CameraHardwareSec::cancelAutoFocus()
{
LOGV("%s :", __func__);
+ // cancelAutoFocus should be allowed after preview is started. But if
+ // the preview is deferred, cancelAutoFocus will fail. Ignore it if that is
+ // the case.
+ if (mPreviewRunning && mPreviewStartDeferred) return NO_ERROR;
+
if (mSecCamera->cancelAutofocus() < 0) {
LOGE("ERR(%s):Fail on mSecCamera->cancelAutofocus()", __func__);
return UNKNOWN_ERROR;