display: Add dbus method return value handling code 78/317678/1 accepted/tizen_unified_dev accepted/tizen/unified/20240924.005933 accepted/tizen/unified/dev/20240924.080624 accepted/tizen/unified/toolchain/20241004.102042 accepted/tizen/unified/x/20240923.124438 accepted/tizen/unified/x/asan/20241014.000444
authorYunhee Seo <yuni.seo@samsung.com>
Fri, 13 Sep 2024 02:15:13 +0000 (11:15 +0900)
committerYunhee Seo <yuni.seo@samsung.com>
Fri, 13 Sep 2024 02:15:13 +0000 (11:15 +0900)
During dbus method logic operation, function return value
goes to direct dbus method return value.
However, dbus method return value is different to
function return value in the logic.
If dbus method logic not fails, then it should return zero.

Change-Id: I2216cb2a0b1d4d5d26274ace20b4d6f2a24da777
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
src/display/display-dbus.c

index ae2c97332b86ced2fdb39f88ad5e9e195ab7f0e4..bbe6dab7e7e8570bbf674ceab6dd0e7121778b1f 100644 (file)
@@ -565,14 +565,14 @@ static GVariant *dbus_holdbrightness(GDBusConnection *conn,
 
        ret = vconf_get_int(VCONFKEY_SETAPPL_BRIGHTNESS_AUTOMATIC_INT, &autobrt);
        if (ret < 0) {
-               _E("Failed to get vconf value for automatic brightness: %d", vconf_get_ext_errno());
+               _W("Cannot get vconf value for automatic brightness: %d", vconf_get_ext_errno());
                autobrt = SETTING_BRIGHTNESS_AUTOMATIC_OFF;
        }
 
        ret = vconf_set_int(VCONFKEY_PM_CUSTOM_BRIGHTNESS_STATUS, VCONFKEY_PM_CUSTOM_BRIGHTNESS_ON);
 
        if (ret < 0)
-               _E("Failed to set vconf value for custom brightness status: %d", vconf_get_ext_errno());
+               _W("Cannot set vconf value for custom brightness status: %d", vconf_get_ext_errno());
 
        ret = syscommon_plugin_deviced_display_control_auto_brightness(BR_HOLD_BRIGHTNESS, brt);
        if (ret == -ENOTSUP || ret == -ENOSYS) {
@@ -587,12 +587,13 @@ static GVariant *dbus_holdbrightness(GDBusConnection *conn,
                _D("Auto brightness will be paused");
                ret = vconf_set_int(VCONFKEY_SETAPPL_BRIGHTNESS_AUTOMATIC_INT, SETTING_BRIGHTNESS_AUTOMATIC_PAUSE);
                if (ret < 0)
-                       _E("Failed to set vconf value for automatic brightness: %d", vconf_get_ext_errno());
+                       _W("Cannot set vconf value for automatic brightness: %d", vconf_get_ext_errno());
        }
 
        pid = gdbus_connection_get_sender_pid(conn, sender);
        _I("Hold brightness pid=%d brt=%d ret=%d", pid, brt, ret);
 
+       ret = 0;
 error:
        return g_variant_new("(i)", ret);
 }
@@ -644,7 +645,7 @@ static GVariant *dbus_releasebrightness(GDBusConnection *conn,
 
        ret = vconf_set_int(VCONFKEY_PM_CUSTOM_BRIGHTNESS_STATUS, VCONFKEY_PM_CUSTOM_BRIGHTNESS_OFF);
        if (ret < 0)
-               _E("Failed to set vconf value for custom brightness status: %d", vconf_get_ext_errno());
+               _W("Cannot set vconf value for custom brightness status: ret(%d)", vconf_get_ext_errno());
 
        ret = display_backlight_get_brightness(&brt);
        if (ret < 0)
@@ -669,9 +670,10 @@ static GVariant *dbus_releasebrightness(GDBusConnection *conn,
                _D("Auto brightness will be enable");
                ret = vconf_set_int(VCONFKEY_SETAPPL_BRIGHTNESS_AUTOMATIC_INT, SETTING_BRIGHTNESS_AUTOMATIC_ON);
                if (ret < 0)
-                       _E("Failed to set vconf value for automatic brightness: %d", vconf_get_ext_errno());
+                       _W("Cannot set vconf value for automatic brightness: ret(%d)", vconf_get_ext_errno());
        }
 
+       ret = 0;
 error:
        return g_variant_new("(i)", ret);
 }