diff options
author | Chien-Yu Chen <cychen@google.com> | 2015-02-19 20:51:11 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-02-19 20:51:18 +0000 |
commit | a9284a8d9e6cb27e6d428be3f70a854d978dc282 (patch) | |
tree | 25f89ab3cac054b130d8c41a14b8898b7b655ba1 /include | |
parent | 658fc18d8e632441cd5d83a4f74b53620cbac1fe (diff) | |
parent | 3068d73c6c7e1f44523b1466b903a9c82408b258 (diff) | |
download | frameworks_av-a9284a8d9e6cb27e6d428be3f70a854d978dc282.zip frameworks_av-a9284a8d9e6cb27e6d428be3f70a854d978dc282.tar.gz frameworks_av-a9284a8d9e6cb27e6d428be3f70a854d978dc282.tar.bz2 |
Merge "camera: implement flashlight control"
Diffstat (limited to 'include')
-rw-r--r-- | include/camera/ICameraService.h | 7 | ||||
-rw-r--r-- | include/camera/ICameraServiceListener.h | 24 |
2 files changed, 31 insertions, 0 deletions
diff --git a/include/camera/ICameraService.h b/include/camera/ICameraService.h index f7f06bb..cc41efe 100644 --- a/include/camera/ICameraService.h +++ b/include/camera/ICameraService.h @@ -53,6 +53,7 @@ public: GET_LEGACY_PARAMETERS, SUPPORTS_CAMERA_API, CONNECT_LEGACY, + SET_TORCH_MODE, }; enum { @@ -142,6 +143,12 @@ public: int clientUid, /*out*/ sp<ICamera>& device) = 0; + + /** + * Turn on or off a camera's 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 0a0e43a..9e8b912 100644 --- a/include/camera/ICameraServiceListener.h +++ b/include/camera/ICameraServiceListener.h @@ -66,9 +66,33 @@ public: STATUS_UNKNOWN = 0xFFFFFFFF, }; + /** + * The torch mode status of a camera. + * + * Initial status will be transmitted with onTorchStatusChanged immediately + * after this listener is added to the service listener list. + */ + 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, + + // Use to initialize variables only + TORCH_STATUS_UNKNOWN = 0xFFFFFFFF, + }; + DECLARE_META_INTERFACE(CameraServiceListener); virtual void onStatusChanged(Status status, int32_t cameraId) = 0; + + virtual void onTorchStatusChanged(TorchStatus status, const String16& cameraId) = 0; }; // ---------------------------------------------------------------------------- |