Apply libsyscommon gdbus api improvement on error handling 06/254606/2 accepted/tizen/unified/20210310.145008 submit/tizen/20210309.090957
authortaemin.yeom <taemin.yeom@samsung.com>
Fri, 5 Mar 2021 06:55:01 +0000 (15:55 +0900)
committertaemin.yeom <taemin.yeom@samsung.com>
Mon, 8 Mar 2021 06:19:47 +0000 (15:19 +0900)
Change-Id: Ie150902e176ec89362920ce6903a9280056a8c5f
Signed-off-by: taemin.yeom <taemin.yeom@samsung.com>
src/display.c
src/haptic.c
src/ir.c
src/led.c
src/pmqos.c
src/power.c
src/temperature.c
src/touchscreen-internal.c

index 2305f45..d6480a1 100644 (file)
@@ -66,7 +66,7 @@ static int alloc_display(void)
 
 int device_display_get_numbers(int *device_number)
 {
-       int ret;
+       int ret, val;
 
        ret = is_feature_display_supported();
        if (!ret)
@@ -79,10 +79,10 @@ int device_display_get_numbers(int *device_number)
        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();
        }
 
@@ -93,7 +93,7 @@ int device_display_get_numbers(int *device_number)
 
 int device_display_get_max_brightness(int display_index, int *max_brightness)
 {
-       int ret;
+       int ret, val;
 
        ret = is_feature_display_supported();
        if (!ret)
@@ -117,10 +117,11 @@ int device_display_get_max_brightness(int display_index, int *max_brightness)
        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;
@@ -129,7 +130,7 @@ int device_display_get_max_brightness(int display_index, int *max_brightness)
 
 int device_display_get_brightness(int display_index, int *brightness)
 {
-       int ret;
+       int ret, val;
 
        ret = is_feature_display_supported();
        if (!ret)
@@ -149,11 +150,12 @@ int device_display_get_brightness(int display_index, int *brightness)
 
        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;
 }
 
@@ -182,7 +184,8 @@ int device_display_set_brightness(int display_index, int brightness)
 
        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
 
@@ -271,7 +274,8 @@ int device_display_change_state(display_state_e state)
        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
@@ -297,7 +301,7 @@ int device_display_change_state(display_state_e state)
 //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)
@@ -323,15 +327,16 @@ int device_display_get_max_brightness_state(int display_index, display_state_e s
 
        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;
        }
 
@@ -342,7 +347,7 @@ int device_display_get_max_brightness_state(int display_index, display_state_e s
 //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)
@@ -365,11 +370,12 @@ int device_display_get_brightness_state(int display_index, display_state_e state
 
        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;
 }
@@ -415,7 +421,8 @@ int device_display_set_brightness_state(int display_index, display_state_e state
 
        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
 
index 6d44d43..1934732 100644 (file)
@@ -78,7 +78,7 @@ static int is_haptic_supported(void)
 
 int device_haptic_get_count(int *device_number)
 {
-       int ret;
+       int ret, val;
 
        if (!device_number)
                return DEVICE_ERROR_INVALID_PARAMETER;
@@ -90,7 +90,7 @@ int device_haptic_get_count(int *device_number)
        /* 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.
@@ -100,7 +100,7 @@ int device_haptic_get_count(int *device_number)
        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;
 }
 
@@ -109,17 +109,17 @@ static void restart_callback(void)
 {
        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;
        }
 
 }
@@ -157,7 +157,7 @@ int device_haptic_open(int device_index, haptic_device_h *device_handle)
        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);
@@ -177,12 +177,12 @@ int device_haptic_open(int device_index, haptic_device_h *device_handle)
        /* 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;
@@ -198,7 +198,7 @@ int device_haptic_open(int device_index, haptic_device_h *device_handle)
 //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;
@@ -247,7 +247,8 @@ int device_haptic_close(haptic_device_h device_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);
 
@@ -265,7 +266,7 @@ int device_haptic_vibrate(haptic_device_h device_handle, int duration, int feedb
        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)
@@ -296,12 +297,13 @@ int device_haptic_vibrate(haptic_device_h device_handle, int duration, int feedb
        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;
 }
@@ -335,7 +337,8 @@ int device_haptic_stop(haptic_device_h device_handle, haptic_effect_h effect_han
        /* 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
 
index 3fe7c4c..9213ea7 100644 (file)
--- a/src/ir.c
+++ b/src/ir.c
@@ -48,7 +48,7 @@ int device_ir_is_available(bool *available)
 
        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)
@@ -97,7 +97,7 @@ int device_ir_transmit(int carrier_frequency, int *pattern, int size)
 
        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
index a5ff47d..d6b0014 100644 (file)
--- a/src/led.c
+++ b/src/led.c
@@ -56,7 +56,7 @@ static void __CONSTRUCTOR__ init(void)
 
 int device_flash_get_max_brightness(int *max_brightness)
 {
-       int ret;
+       int ret, val;
 
        if (!support_camera_led)
                return DEVICE_ERROR_NOT_SUPPORTED;
@@ -66,17 +66,17 @@ int device_flash_get_max_brightness(int *max_brightness)
 
        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;
@@ -86,11 +86,11 @@ int device_flash_get_brightness(int *brightness)
 
        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;
 }
 
@@ -111,7 +111,7 @@ int device_flash_set_brightness(int brightness)
        /* 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
 
@@ -130,7 +130,7 @@ int device_led_play_custom(int on, int off, unsigned int color, unsigned int fla
 
        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);
@@ -148,7 +148,7 @@ int device_led_stop_custom(void)
 
        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);
@@ -160,7 +160,7 @@ int device_led_stop_custom(void)
 //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;
@@ -171,10 +171,10 @@ int device_multi_led_get_number(int *num_of_leds)
        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;
@@ -210,7 +210,7 @@ int device_multi_led_control(unsigned int color[])
        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
 
index 7373edc..163a595 100644 (file)
@@ -34,7 +34,7 @@ int device_pmqos_app_launch_home(int timeout)
                        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
 
@@ -54,7 +54,7 @@ int device_pmqos_homescreen(int timeout)
                        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
 
index 238f2d7..cb93172 100644 (file)
@@ -369,7 +369,8 @@ static int lock_state(display_state_e state, unsigned int flag, int timeout_ms)
 
                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;
@@ -422,7 +423,8 @@ static int unlock_state(display_state_e state, unsigned int flag)
 
                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;
@@ -559,7 +561,7 @@ int device_power_reboot(const char *reason)
        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
@@ -571,7 +573,8 @@ int device_power_poweroff(void)
 
        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);
 }
index 29c9786..2712d57 100644 (file)
@@ -59,7 +59,7 @@ static int is_temperature_supported(device_thermal_e type)
 
 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;
@@ -71,11 +71,12 @@ int device_thermal_get_temperature(device_thermal_e type, int *temp)
        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;
 }
 
index a333cfb..9b93082 100644 (file)
@@ -27,9 +27,9 @@ int device_touchscreen_enable(dbus_pending_cb cb)
 {
        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);
 }
@@ -40,9 +40,9 @@ int device_touchscreen_disable(dbus_pending_cb cb)
 {
        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);
 }