diff options
author | Chih-Chung Chang <chihchung@google.com> | 2009-09-15 14:51:56 +0800 |
---|---|---|
committer | Chih-Chung Chang <chihchung@google.com> | 2009-09-15 18:29:03 +0800 |
commit | 244f8c26365a303d9dd861bd48a29a4b48578da1 (patch) | |
tree | 33c20568a94d606507507ec5cedf2a01eba8de58 /camera/libcameraservice/CameraService.cpp | |
parent | 54c06152e0d9c666aec61ae5d9686d7d3327ea34 (diff) | |
download | frameworks_base-244f8c26365a303d9dd861bd48a29a4b48578da1.zip frameworks_base-244f8c26365a303d9dd861bd48a29a4b48578da1.tar.gz frameworks_base-244f8c26365a303d9dd861bd48a29a4b48578da1.tar.bz2 |
Fix 2083478: Camera needs an auto-focus cancel API
Change-Id: I13bda991b32aee47e82b5cf9d43b3021c416a9a2
Diffstat (limited to 'camera/libcameraservice/CameraService.cpp')
-rw-r--r-- | camera/libcameraservice/CameraService.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/camera/libcameraservice/CameraService.cpp b/camera/libcameraservice/CameraService.cpp index f425f6b..bab7d08 100644 --- a/camera/libcameraservice/CameraService.cpp +++ b/camera/libcameraservice/CameraService.cpp @@ -798,7 +798,6 @@ static void dump_to_file(const char *fname, } #endif -// take a picture - image is returned in callback status_t CameraService::Client::autoFocus() { LOGD("autoFocus (pid %d)", getCallingPid()); @@ -815,6 +814,22 @@ status_t CameraService::Client::autoFocus() return mHardware->autoFocus(); } +status_t CameraService::Client::cancelAutoFocus() +{ + LOGD("cancelAutoFocus (pid %d)", getCallingPid()); + + Mutex::Autolock lock(mLock); + status_t result = checkPid(); + if (result != NO_ERROR) return result; + + if (mHardware == 0) { + LOGE("mHardware is NULL, returning."); + return INVALID_OPERATION; + } + + return mHardware->cancelAutoFocus(); +} + // take a picture - image is returned in callback status_t CameraService::Client::takePicture() { |