summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChien-Yu Chen <cychen@google.com>2015-03-03 22:20:37 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-03-03 22:20:38 +0000
commit38445e493d4cab2abc29515fd3f2ce2e411a6868 (patch)
tree09303b3079864d8a921d45c14d591addb25ee965 /include
parentd702a568cb62e5aebe048147350bb3c76f9386ba (diff)
parent88da526d97442c80731e01bfc94c6b47c4b0c3c7 (diff)
downloadframeworks_av-38445e493d4cab2abc29515fd3f2ce2e411a6868.zip
frameworks_av-38445e493d4cab2abc29515fd3f2ce2e411a6868.tar.gz
frameworks_av-38445e493d4cab2abc29515fd3f2ce2e411a6868.tar.bz2
Merge "camera: fix flashlight implementation for HAL v2"
Diffstat (limited to 'include')
-rw-r--r--include/camera/ICameraService.h11
-rw-r--r--include/camera/ICameraServiceListener.h18
2 files changed, 20 insertions, 9 deletions
diff --git a/include/camera/ICameraService.h b/include/camera/ICameraService.h
index cc41efe..194a646 100644
--- a/include/camera/ICameraService.h
+++ b/include/camera/ICameraService.h
@@ -145,7 +145,16 @@ public:
sp<ICamera>& device) = 0;
/**
- * Turn on or off a camera's torch mode.
+ * Turn on or off a camera's torch mode. Torch mode will be turned off by
+ * camera service if the lastest client binder that turns it on dies.
+ *
+ * return values:
+ * 0: on a successful operation.
+ * -ENOSYS: the camera device doesn't support this operation. It it returned
+ * if and only if android.flash.into.available is false.
+ * -EBUSY: the camera device is opened.
+ * -EINVAL: camera_id is invalid or clientBinder is NULL when enabling a
+ * torch mode.
*/
virtual status_t setTorchMode(const String16& cameraId, bool enabled,
const sp<IBinder>& clientBinder) = 0;
diff --git a/include/camera/ICameraServiceListener.h b/include/camera/ICameraServiceListener.h
index 9e8b912..709ff31 100644
--- a/include/camera/ICameraServiceListener.h
+++ b/include/camera/ICameraServiceListener.h
@@ -71,18 +71,20 @@ public:
*
* Initial status will be transmitted with onTorchStatusChanged immediately
* after this listener is added to the service listener list.
+ *
+ * The enums should be set to values matching
+ * include/hardware/camera_common.h
*/
enum TorchStatus {
- // The camera's torch mode has become available to use via
- // setTorchMode().
- TORCH_STATUS_AVAILABLE = TORCH_MODE_STATUS_AVAILABLE,
// The camera's torch mode has become not available to use via
// setTorchMode().
- TORCH_STATUS_NOT_AVAILABLE = TORCH_MODE_STATUS_RESOURCE_BUSY,
- // The camera's torch mode has been turned off by setTorchMode().
- TORCH_STATUS_OFF = TORCH_MODE_STATUS_OFF,
- // The camera's torch mode has been turned on by setTorchMode().
- TORCH_STATUS_ON = 0x80000000,
+ TORCH_STATUS_NOT_AVAILABLE = TORCH_MODE_STATUS_NOT_AVAILABLE,
+ // The camera's torch mode is off and available to be turned on via
+ // setTorchMode().
+ TORCH_STATUS_AVAILABLE_OFF = TORCH_MODE_STATUS_AVAILABLE_OFF,
+ // The camera's torch mode is on and available to be turned off via
+ // setTorchMode().
+ TORCH_STATUS_AVAILABLE_ON = TORCH_MODE_STATUS_AVAILABLE_ON,
// Use to initialize variables only
TORCH_STATUS_UNKNOWN = 0xFFFFFFFF,