OSDN Git Service

camera_common: change torch status callback API
authorChien-Yu Chen <cychen@google.com>
Wed, 25 Feb 2015 22:50:13 +0000 (14:50 -0800)
committerZhijun He <zhijunhe@google.com>
Wed, 18 Mar 2015 03:03:08 +0000 (20:03 -0700)
commit36629dc7641b08a36e5ea60bf86169e9df1afeb6
tree0d1d2a15a39808dc6973c645da6acd40b388d160
parenta14f883d3ce3ed59e8280a75036afb760baa2191
camera_common: change torch status callback API

Update the torch status callback API so that HAL must invoke
the torch status callback whenever the torch status changes
including changes by set_torch_mode().

The problem of the previous approach was camera service needed
to invoke the callback after calling set_torch_mode() and two
sources of the torch status changes (HAL and camera service)
caused a race condition.

Add STATUS_ON and remove STATUS_AVAILABLE which isn't useful
because STATUS_OFF means torch is off and available. STATUS_ON
means torch is on and available.

Bug: 2682206
Change-Id: Ide5d289c5f485404a3ba46e6cb359fa8a52da0bb
include/hardware/camera_common.h