Fix 2083478: Camera needs an auto-focus cancel API
Change-Id: I13bda991b32aee47e82b5cf9d43b3021c416a9a2
diff --git a/libs/ui/ICamera.cpp b/libs/ui/ICamera.cpp
index 805c2ca..fd7e084 100644
--- a/libs/ui/ICamera.cpp
+++ b/libs/ui/ICamera.cpp
@@ -32,6 +32,7 @@
START_PREVIEW,
STOP_PREVIEW,
AUTO_FOCUS,
+ CANCEL_AUTO_FOCUS,
TAKE_PICTURE,
SET_PARAMETERS,
GET_PARAMETERS,
@@ -162,6 +163,17 @@
return ret;
}
+ // cancel focus
+ status_t cancelAutoFocus()
+ {
+ LOGV("cancelAutoFocus");
+ Parcel data, reply;
+ data.writeInterfaceToken(ICamera::getInterfaceDescriptor());
+ remote()->transact(CANCEL_AUTO_FOCUS, data, &reply);
+ status_t ret = reply.readInt32();
+ return ret;
+ }
+
// take a picture - returns an IMemory (ref-counted mmap)
status_t takePicture()
{
@@ -294,6 +306,12 @@
reply->writeInt32(autoFocus());
return NO_ERROR;
} break;
+ case CANCEL_AUTO_FOCUS: {
+ LOGV("CANCEL_AUTO_FOCUS");
+ CHECK_INTERFACE(ICamera, data, reply);
+ reply->writeInt32(cancelAutoFocus());
+ return NO_ERROR;
+ } break;
case TAKE_PICTURE: {
LOGV("TAKE_PICTURE");
CHECK_INTERFACE(ICamera, data, reply);