int device_display_set_brightness(int display_index, int brightness)
{
int ret_val, max;
+ int ret_dbus;
ret_val = is_feature_display_supported();
if (!ret_val)
if (brightness < 0 || brightness > display_arr[display_index].normal_max)
return DEVICE_ERROR_INVALID_PARAMETER;
- ret_val = gdbus_call_sync_with_reply_int(DEVICED_BUS_NAME,
+ ret_dbus = gdbus_call_sync_with_reply_int(DEVICED_BUS_NAME,
DEVICED_PATH_DISPLAY, DEVICED_INTERFACE_DISPLAY,
METHOD_SET_BRIGHTNESS, g_variant_new("(ii)", (int)DISPLAY_STATE_NORMAL, brightness),
- NULL);
+ &ret_val);
+
+ if (ret_dbus < 0)
+ return DEVICE_ERROR_OPERATION_FAILED;
+
if (ret_val < 0)
return errno_to_device_error(ret_val); //LCOV_EXCL_LINE System Error