summaryrefslogtreecommitdiffstats
path: root/include/camera/ICameraServiceListener.h
diff options
context:
space:
mode:
authorChien-Yu Chen <cychen@google.com>2015-02-17 13:56:46 -0800
committerChien-Yu Chen <cychen@google.com>2015-03-03 14:07:47 -0800
commit88da526d97442c80731e01bfc94c6b47c4b0c3c7 (patch)
treed62e3b5051bd55ac6f2bb0e4762a15be28650c5a /include/camera/ICameraServiceListener.h
parent7841f704fee0e5acd45fa6e47a336120c3cad42c (diff)
downloadframeworks_av-88da526d97442c80731e01bfc94c6b47c4b0c3c7.zip
frameworks_av-88da526d97442c80731e01bfc94c6b47c4b0c3c7.tar.gz
frameworks_av-88da526d97442c80731e01bfc94c6b47c4b0c3c7.tar.bz2
camera: fix flashlight implementation for HAL v2
Update torch availability when the camera device availability changes. For device HAL v2 and v3 implementation, notify torch unavailable for all camera devices with a flash unit when a camera device is opened. Notify torch available for all camera devices with flash unit when all camera devices are closed. Don't invoke torch status callback in camera service. Invoke torch status callback in HAL or FlashControlBase implementations to avoid race condition. Clean up previous CL. Bug: 2682206 Change-Id: I24f5478f467b2c680565fe98f112eef33e2547a1
Diffstat (limited to 'include/camera/ICameraServiceListener.h')
-rw-r--r--include/camera/ICameraServiceListener.h18
1 files changed, 10 insertions, 8 deletions
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,