Flash led can't control camera flash when camera API preempted flash.
In this case, led api will return DEVICE_ERROR_RESOURCE_BUSY error.
Change-Id: I13c1cbccb854be5a0309711145a69a010adfe94c
Signed-off-by: Jiyoung Yun <jy910.yun@samsung.com>
DEVICE_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
DEVICE_ERROR_ALREADY_IN_PROGRESS = TIZEN_ERROR_ALREADY_IN_PROGRESS, /**< Operation already in progress */
DEVICE_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, /**< Not supported in this device */
+ DEVICE_ERROR_RESOURCE_BUSY = TIZEN_ERROR_RESOURCE_BUSY, /**< Device or resource busy */
DEVICE_ERROR_NOT_INITIALIZED = TIZEN_ERROR_DEVICE | 0x13, /**< Not initialized */
} device_error_e;
* @privlevel public
* @privilege %http://tizen.org/privilege/led
*
+ * @remarks Since 2.4, this API check camera flash status whether camera API preempted flash or not, so it could be failed if flash was preempted by camera API. In this case, API will return #DEVICE_ERROR_RESOURCE_BUSY error.
+ *
* @param[in] brightness The brightness value of LED (@c 0 ~ MAX)
*
* @return @c 0 on success,
* @retval #DEVICE_ERROR_PERMISSION_DENIED Permission denied
* @retval #DEVICE_ERROR_OPERATION_FAILED Operation failed
* @retval #DEVICE_ERROR_NOT_SUPPORTED Not supported device
+ * @retval #DEVICE_ERROR_RESOURCE_BUSY Device or resource busy
*/
int device_flash_set_brightness(int brightness);
{
if (err == -EACCES)
return DEVICE_ERROR_PERMISSION_DENIED;
+ else if (err == -EBUSY)
+ return DEVICE_ERROR_RESOURCE_BUSY;
else if (err == -ENOTSUP || err == -ENODEV || err == -ENOENT)
return DEVICE_ERROR_NOT_SUPPORTED;
else if (err < 0)
snprintf(buf_noti, sizeof(buf_noti), "%d", 0);
arr[1] = buf_noti;
+ /* if camera API preempt a flash device, it will return -EBUSY error. */
ret = dbus_method_sync(DEVICED_BUS_NAME,
DEVICED_PATH_LED, DEVICED_INTERFACE_LED,
METHOD_SET_BRIGHTNESS, "ii", arr);