int device_display_get_numbers(int *device_number)
{
- int ret;
+ int ret, val;
ret = is_feature_display_supported();
if (!ret)
if (display_cnt < 0) {
ret = dbus_handle_method_sync_var(DEVICED_BUS_NAME,
DEVICED_PATH_DISPLAY, DEVICED_INTERFACE_DISPLAY,
- METHOD_GET_DISPLAY_COUNT, NULL);
+ METHOD_GET_DISPLAY_COUNT, NULL, &val);
if (ret < 0)
return errno_to_device_error(ret); //LCOV_EXCL_LINE System Error
- display_cnt = ret;
+ display_cnt = val;
alloc_display();
}
int device_display_get_max_brightness(int display_index, int *max_brightness)
{
- int ret;
+ int ret, val;
ret = is_feature_display_supported();
if (!ret)
if (display_arr[display_index].normal_max < 0) {
ret = dbus_handle_method_sync_var(DEVICED_BUS_NAME,
DEVICED_PATH_DISPLAY, DEVICED_INTERFACE_DISPLAY,
- METHOD_GET_MAX_BRIGHTNESS, g_variant_new("(i)", (int)DISPLAY_STATE_NORMAL));
+ METHOD_GET_MAX_BRIGHTNESS, g_variant_new("(i)", (int)DISPLAY_STATE_NORMAL),
+ &val);
if (ret < 0)
return errno_to_device_error(ret); //LCOV_EXCL_LINE System Error
- display_arr[display_index].normal_max = ret;
+ display_arr[display_index].normal_max = val;
}
*max_brightness = display_arr[display_index].normal_max;
int device_display_get_brightness(int display_index, int *brightness)
{
- int ret;
+ int ret, val;
ret = is_feature_display_supported();
if (!ret)
ret = dbus_handle_method_sync_var(DEVICED_BUS_NAME,
DEVICED_PATH_DISPLAY, DEVICED_INTERFACE_DISPLAY,
- METHOD_GET_BRIGHTNESS, g_variant_new("(i)", (int)DISPLAY_STATE_NORMAL));
+ METHOD_GET_BRIGHTNESS, g_variant_new("(i)", (int)DISPLAY_STATE_NORMAL),
+ &val);
if (ret < 0)
return errno_to_device_error(ret); //LCOV_EXCL_LINE System Error
- *brightness = ret;
+ *brightness = val;
return DEVICE_ERROR_NONE;
}
ret = dbus_handle_method_sync_var(DEVICED_BUS_NAME,
DEVICED_PATH_DISPLAY, DEVICED_INTERFACE_DISPLAY,
- METHOD_SET_BRIGHTNESS, g_variant_new("(ii)", (int)DISPLAY_STATE_NORMAL, brightness));
+ METHOD_SET_BRIGHTNESS, g_variant_new("(ii)", (int)DISPLAY_STATE_NORMAL, brightness),
+ NULL);
if (ret < 0)
return errno_to_device_error(ret); //LCOV_EXCL_LINE System Error
if (privilege < 0) {
ret = dbus_handle_method_sync_var(DEVICED_BUS_NAME,
DEVICED_PATH_DISPLAY, DEVICED_INTERFACE_DISPLAY,
- METHOD_CHANGE_STATE, g_variant_new("(s)", "privilege check"));
+ METHOD_CHANGE_STATE, g_variant_new("(s)", "privilege check"),
+ NULL);
//LCOV_EXCL_START System Error
if (ret < 0)
return errno_to_device_error(ret); //LCOV_EXCL_LINE System Error
//LCOV_EXCL_START Not tested API
int device_display_get_max_brightness_state(int display_index, display_state_e state, int *brightness)
{
- int ret;
+ int ret, val;
ret = is_feature_display_supported();
if (!ret)
ret = dbus_handle_method_sync_var(DEVICED_BUS_NAME,
DEVICED_PATH_DISPLAY, DEVICED_INTERFACE_DISPLAY,
- METHOD_GET_MAX_BRIGHTNESS, g_variant_new("(i)", (int)state));
+ METHOD_GET_MAX_BRIGHTNESS, g_variant_new("(i)", (int)state),
+ &val);
if (ret < 0)
return errno_to_device_error(ret); //LCOV_EXCL_LINE System Error
if (state == DISPLAY_STATE_NORMAL) {
- display_arr[display_index].normal_max = ret;
+ display_arr[display_index].normal_max = val;
*brightness = display_arr[display_index].normal_max;
} else {
- display_arr[display_index].dim_max = ret;
+ display_arr[display_index].dim_max = val;
*brightness = display_arr[display_index].dim_max;
}
//LCOV_EXCL_START Not tested API
int device_display_get_brightness_state(int display_index, display_state_e state, int *brightness)
{
- int ret;
+ int ret, val;
ret = is_feature_display_supported();
if (!ret)
ret = dbus_handle_method_sync_var(DEVICED_BUS_NAME,
DEVICED_PATH_DISPLAY, DEVICED_INTERFACE_DISPLAY,
- METHOD_GET_BRIGHTNESS, g_variant_new("(i)", (int)state));
+ METHOD_GET_BRIGHTNESS, g_variant_new("(i)", (int)state),
+ &val);
if (ret < 0)
return errno_to_device_error(ret); //LCOV_EXCL_LINE System Error
- *brightness = ret;
+ *brightness = val;
return DEVICE_ERROR_NONE;
}
ret = dbus_handle_method_sync_var(DEVICED_BUS_NAME,
DEVICED_PATH_DISPLAY, DEVICED_INTERFACE_DISPLAY,
- METHOD_SET_BRIGHTNESS, g_variant_new("(ii)", (int)state, brightness));
+ METHOD_SET_BRIGHTNESS, g_variant_new("(ii)", (int)state, brightness),
+ NULL);
if (ret < 0)
return errno_to_device_error(ret); //LCOV_EXCL_LINE System Error
int device_haptic_get_count(int *device_number)
{
- int ret;
+ int ret, val;
if (!device_number)
return DEVICE_ERROR_INVALID_PARAMETER;
/* request to deviced to get haptic count */
ret = dbus_handle_method_sync_var(VIBRATOR_BUS_NAME,
VIBRATOR_PATH_HAPTIC, VIBRATOR_INTERFACE_HAPTIC,
- METHOD_GET_COUNT, NULL);
+ METHOD_GET_COUNT, NULL, &val);
/**
* there is no haptic method in no vibration model.
* so -ENOTSUP means that haptic count is zero.
else if (ret < 0)
return errno_to_device_error(ret); //LCOV_EXCL_LINE System Error
- *device_number = ret;
+ *device_number = val;
return DEVICE_ERROR_NONE;
}
{
GList *elem, *elem_next;
struct haptic_handle *temp;
- int ret;
+ int ret, val;
SYS_G_LIST_FOREACH_SAFE(handle_list, elem, elem_next, temp) {
ret = dbus_handle_method_sync_var(VIBRATOR_BUS_NAME,
VIBRATOR_PATH_HAPTIC, VIBRATOR_INTERFACE_HAPTIC,
- METHOD_OPEN_DEVICE, g_variant_new("(i)", temp->index));
+ METHOD_OPEN_DEVICE, g_variant_new("(i)", temp->index), &val);
if (ret < 0) {
_E("Failed to open device");
continue;
}
- temp->handle = ret;
+ temp->handle = val;
}
}
GList *elem, *elem_next;
struct haptic_handle *handle;
struct haptic_handle *temp;
- int ret, max;
+ int ret, max, val;
bool found = false;
ret = device_haptic_get_count(&max);
/* request to deviced to open haptic device */
ret = dbus_handle_method_sync_var(VIBRATOR_BUS_NAME,
VIBRATOR_PATH_HAPTIC, VIBRATOR_INTERFACE_HAPTIC,
- METHOD_OPEN_DEVICE, g_variant_new("(i)", device_index));
+ METHOD_OPEN_DEVICE, g_variant_new("(i)", device_index), &val);
if (ret < 0)
return errno_to_device_error(ret); //LCOV_EXCL_LINE System Error
SYS_G_LIST_FOREACH_SAFE(handle_list, elem, elem_next, temp) {
- if (temp->handle == ret) {
+ if (temp->handle == val) {
found = true;
temp->index = device_index;
break;
//LCOV_EXCL_STOP
}
- handle->handle = ret;
+ handle->handle = val;
handle->index = device_index;
SYS_G_LIST_APPEND(handle_list, handle);
*device_handle = (haptic_device_h)handle;
/* request to deviced to open haptic device */
ret = dbus_handle_method_sync_var(VIBRATOR_BUS_NAME,
VIBRATOR_PATH_HAPTIC, VIBRATOR_INTERFACE_HAPTIC,
- METHOD_CLOSE_DEVICE, g_variant_new("(u)", (unsigned int)handle->handle));
+ METHOD_CLOSE_DEVICE, g_variant_new("(u)", (unsigned int)handle->handle),
+ NULL);
free(handle);
GList *elem, *elem_next;
struct haptic_handle *handle = (struct haptic_handle *)device_handle;
struct haptic_handle *temp;
- int ret, priority;
+ int ret, priority, val;
bool found = false;
if (!device_handle)
ret = dbus_handle_method_sync_var(VIBRATOR_BUS_NAME,
VIBRATOR_PATH_HAPTIC, VIBRATOR_INTERFACE_HAPTIC,
METHOD_VIBRATE_MONOTONE,
- g_variant_new("(uiii)", (unsigned int)handle->handle, duration, feedback, priority));
+ g_variant_new("(uiii)", (unsigned int)handle->handle, duration, feedback, priority),
+ &val);
if (ret < 0)
return errno_to_device_error(ret); //LCOV_EXCL_LINE System Error
if (effect_handle)
- *effect_handle = (haptic_effect_h)ret;
+ *effect_handle = (haptic_effect_h)val;
return DEVICE_ERROR_NONE;
}
/* request to deviced to open haptic device */
ret = dbus_handle_method_sync_var(VIBRATOR_BUS_NAME,
VIBRATOR_PATH_HAPTIC, VIBRATOR_INTERFACE_HAPTIC,
- METHOD_STOP_DEVICE, g_variant_new("(u)", (unsigned int)handle->handle));
+ METHOD_STOP_DEVICE, g_variant_new("(u)", (unsigned int)handle->handle),
+ NULL);
if (ret < 0)
return errno_to_device_error(ret); //LCOV_EXCL_LINE System Error
ret = dbus_handle_method_sync_var(DEVICED_BUS_NAME, DEVICED_PATH_IR,
DEVICED_INTERFACE_IR, METHOD_IS_AVAILABLE,
- NULL);
+ NULL, NULL);
//LCOV_EXCL_START System Error
if (ret == -EACCES || ret == -EPERM)
ret = dbus_handle_method_sync_var(DEVICED_BUS_NAME, DEVICED_PATH_IR,
DEVICED_INTERFACE_IR, METHOD_TRANSMIT,
- g_variant_new("(ai)", builder));
+ g_variant_new("(ai)", builder), NULL);
g_variant_builder_unref(builder);
//LCOV_EXCL_START System Error
int device_flash_get_max_brightness(int *max_brightness)
{
- int ret;
+ int ret, val;
if (!support_camera_led)
return DEVICE_ERROR_NOT_SUPPORTED;
ret = dbus_handle_method_sync_var(DEVICED_BUS_NAME,
DEVICED_PATH_LED, DEVICED_INTERFACE_LED,
- METHOD_GET_MAX_BRIGHTNESS, NULL);
+ METHOD_GET_MAX_BRIGHTNESS, NULL, &val);
if (ret < 0)
return errno_to_device_error(ret); //LCOV_EXCL_LINE System Error
- *max_brightness = ret;
+ *max_brightness = val;
return DEVICE_ERROR_NONE;
}
int device_flash_get_brightness(int *brightness)
{
- int ret;
+ int ret, val;
if (!support_camera_led)
return DEVICE_ERROR_NOT_SUPPORTED;
ret = dbus_handle_method_sync_var(DEVICED_BUS_NAME,
DEVICED_PATH_LED, DEVICED_INTERFACE_LED,
- METHOD_GET_BRIGHTNESS, NULL);
+ METHOD_GET_BRIGHTNESS, NULL, &val);
if (ret < 0)
return errno_to_device_error(ret); //LCOV_EXCL_LINE System Error
- *brightness = ret;
+ *brightness = val;
return DEVICE_ERROR_NONE;
}
/* if camera API preempt a flash device, it will return -EBUSY error. */
ret = dbus_handle_method_sync_var(DEVICED_BUS_NAME,
DEVICED_PATH_LED, DEVICED_INTERFACE_LED,
- METHOD_SET_BRIGHTNESS, g_variant_new("(ii)", brightness, 0));
+ METHOD_SET_BRIGHTNESS, g_variant_new("(ii)", brightness, 0), NULL);
if (ret < 0)
return errno_to_device_error(ret); //LCOV_EXCL_LINE System Error
ret = dbus_handle_method_sync_var(DEVICED_BUS_NAME,
DEVICED_PATH_LED, DEVICED_INTERFACE_LED,
- METHOD_PLAY_CUSTOM, g_variant_new("(iiuu)", on, off, (unsigned int)color, (unsigned int)flags));
+ METHOD_PLAY_CUSTOM, g_variant_new("(iiuu)", on, off, (unsigned int)color, (unsigned int)flags), NULL);
//LCOV_EXCL_START System Error
if (ret < 0)
return errno_to_device_error(ret);
ret = dbus_handle_method_sync_var(DEVICED_BUS_NAME,
DEVICED_PATH_LED, DEVICED_INTERFACE_LED,
- METHOD_STOP_CUSTOM, NULL);
+ METHOD_STOP_CUSTOM, NULL, NULL);
//LCOV_EXCL_START System Error
if (ret < 0)
return errno_to_device_error(ret);
//LCOV_EXCL_START Not tested API
int device_multi_led_get_number(int *num_of_leds)
{
- int ret;
+ int ret, val;
if (!support_front_led)
return DEVICE_ERROR_NOT_SUPPORTED;
if (number_of_devices < 0) {
ret = dbus_handle_method_sync_var(DEVICED_BUS_NAME,
DEVICED_PATH_LED, DEVICED_INTERFACE_LED,
- METHOD_GET_LED_NUMBER, NULL);
+ METHOD_GET_LED_NUMBER, NULL, &val);
if (ret < 0)
return errno_to_device_error(ret); //LCOV_EXCL_LINE System Error
- number_of_devices = ret;
+ number_of_devices = val;
}
*num_of_leds = number_of_devices;
g_variant_builder_unref(builder);
ret = dbus_handle_method_sync_var(DEVICED_BUS_NAME, DEVICED_PATH_LED,
- DEVICED_INTERFACE_LED, METHOD_MULTI_LED_CONTROL, var);
+ DEVICED_INTERFACE_LED, METHOD_MULTI_LED_CONTROL, var, NULL);
if (ret < 0)
return errno_to_device_error(ret); //LCOV_EXCL_LINE System Error
DEVICED_PATH_PMQOS,
DEVICED_INTERFACE_PMQOS,
METHOD_APP_LAUNCH_HOME,
- g_variant_new("(i)", timeout));
+ g_variant_new("(i)", timeout), NULL);
if (ret < 0)
return errno_to_device_error(ret); //LCOV_EXCL_LINE System Error
DEVICED_PATH_PMQOS,
DEVICED_INTERFACE_PMQOS,
METHOD_HOMESCREEN,
- g_variant_new("(i)", timeout));
+ g_variant_new("(i)", timeout), NULL);
if (ret < 0)
return errno_to_device_error(ret); //LCOV_EXCL_LINE System Error
ret = dbus_handle_method_sync_var(DEVICED_BUS_NAME,
DEVICED_PATH_DISPLAY, DEVICED_INTERFACE_DISPLAY,
- METHOD_LOCK_STATE, g_variant_new("(sssi)", arr[0], arr[1], arr[2], timeout_ms));
+ METHOD_LOCK_STATE, g_variant_new("(sssi)", arr[0], arr[1], arr[2], timeout_ms),
+ NULL);
//LCOV_EXCL_START System Error
if (ret < 0)
return ret;
ret = dbus_handle_method_sync_var(DEVICED_BUS_NAME,
DEVICED_PATH_DISPLAY, DEVICED_INTERFACE_DISPLAY,
- METHOD_UNLOCK_STATE, g_variant_new("(ss)", arr[0], arr[1]));
+ METHOD_UNLOCK_STATE, g_variant_new("(ss)", arr[0], arr[1]),
+ NULL);
//LCOV_EXCL_START System Error
if (ret < 0)
return ret;
ret = dbus_handle_method_sync_var(DEVICED_BUS_NAME,
DEVICED_PATH_POWEROFF,
DEVICED_INTERFACE_POWEROFF,
- method, param);
+ method, param, NULL);
return errno_to_device_error(ret);
}
//LCOV_EXCL_STOP
ret = dbus_handle_method_sync_var(DEVICED_BUS_NAME,
DEVICED_PATH_POWEROFF, DEVICED_INTERFACE_POWEROFF,
- METHOD_POWEROFF, g_variant_new("(s)", TYPE_POWEROFF));
+ METHOD_POWEROFF, g_variant_new("(s)", TYPE_POWEROFF),
+ NULL);
return errno_to_device_error(ret);
}
int device_thermal_get_temperature(device_thermal_e type, int *temp)
{
- int ret;
+ int ret, val;
if (type > DEVICE_THERMAL_BATTERY)
return DEVICE_ERROR_INVALID_PARAMETER;
ret = dbus_handle_method_sync_var(DEVICED_BUS_NAME,
DEVICED_PATH_TEMPERATURE,
DEVICED_INTERFACE_TEMPERATURE,
- METHOD_GET_TEMPERATURE, g_variant_new("(i)", type));
+ METHOD_GET_TEMPERATURE, g_variant_new("(i)", type),
+ &val);
if (ret < 0)
return errno_to_device_error(ret); //LCOV_EXCL_LINE System Error
- *temp = ret;
+ *temp = val;
return DEVICE_ERROR_NONE;
}
{
int ret;
- ret = dbus_handle_method_async_with_reply(DEVICED_BUS_NAME,
+ ret = dbus_handle_method_async_with_reply_var(DEVICED_BUS_NAME,
DEVICED_PATH_TOUCH, DEVICED_INTERFACE_TOUCH,
- METHOD_TOUCHSCREEN_ENABLE, NULL, NULL, cb, -1, NULL);
+ METHOD_TOUCHSCREEN_ENABLE, NULL, cb, -1, NULL);
return errno_to_device_error(ret);
}
{
int ret;
- ret = dbus_handle_method_async_with_reply(DEVICED_BUS_NAME,
+ ret = dbus_handle_method_async_with_reply_var(DEVICED_BUS_NAME,
DEVICED_PATH_TOUCH, DEVICED_INTERFACE_TOUCH,
- METHOD_TOUCHSCREEN_DISABLE, NULL, NULL, cb, -1, NULL);
+ METHOD_TOUCHSCREEN_DISABLE, NULL, cb, -1, NULL);
return errno_to_device_error(ret);
}