From f7ae987b696b2d775bae81899fb7dcb3b6622176 Mon Sep 17 00:00:00 2001 From: Wu-cheng Li Date: Thu, 13 Oct 2011 16:08:18 +0800 Subject: Fix cancelAutoFocus failure if native window is not set. cancelAutoFocus should be allowed after preview is started. But if the preview is deferred, cancelAutoFocus will fail. Ignore it if that is the case. bug:5397951 Change-Id: I59a73add90bd057d7f44d88518b74d932991f21a --- libcamera/SecCameraHWInterface.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libcamera') 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; -- cgit v1.1