From: Yunhee Seo Date: Mon, 29 Jul 2024 05:11:56 +0000 (+0900) Subject: display: Support dim brightness setting X-Git-Tag: accepted/tizen/7.0/unified/20240730.133927^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=17835b74f9f4b543975f7f53c70e072c12d34a9f;p=platform%2Fcore%2Fsystem%2Fdeviced.git display: Support dim brightness setting The dim brightness setting feature had been supported before but it was no longer available after ce471ec18f19bb184848f4c84e813b834ef4bdee commit. Although there were descriptions and functions provided for setting dim brightness, it's not right that it cannot be used, so it is restored. Change-Id: Ifd8f5f263fb07def409c17cdeadc53fcafefcf6f Signed-off-by: Yunhee Seo --- diff --git a/plugins/iot-headed/display/device-interface.c b/plugins/iot-headed/display/device-interface.c index 1d716b7c..8e9a6408 100644 --- a/plugins/iot-headed/display/device-interface.c +++ b/plugins/iot-headed/display/device-interface.c @@ -268,8 +268,15 @@ static int backlight_off(enum device_flags flags) static int backlight_dim(void) { int ret; + int dim_brightness; - ret = backlight_ops.set_brightness(PM_DIM_BRIGHTNESS); + ret = vconf_get_int(VCONFKEY_SETAPPL_LCD_DIM_BRIGHTNESS, &dim_brightness); + if (ret < 0) { + _E("Failed to get vconf value for VCONFKEY_SETAPPL_LCD_DIM_BRIGHTNESS: %d", vconf_get_ext_errno()); + return ret; + } + + ret = backlight_ops.set_brightness(dim_brightness); #ifdef ENABLE_PM_LOG if (!ret) pm_history_save(PM_LOG_LCD_DIM, get_pm_cur_state()); diff --git a/plugins/mobile/display/device-interface.c b/plugins/mobile/display/device-interface.c index f35f24d1..66d8e923 100644 --- a/plugins/mobile/display/device-interface.c +++ b/plugins/mobile/display/device-interface.c @@ -267,8 +267,15 @@ static int backlight_off(enum device_flags flags) static int backlight_dim(void) { int ret; + int dim_brightness; - ret = backlight_ops.set_brightness(PM_DIM_BRIGHTNESS); + ret = vconf_get_int(VCONFKEY_SETAPPL_LCD_DIM_BRIGHTNESS, &dim_brightness); + if (ret < 0) { + _E("Failed to get vconf value for VCONFKEY_SETAPPL_LCD_DIM_BRIGHTNESS: %d", vconf_get_ext_errno()); + return ret; + } + + ret = backlight_ops.set_brightness(dim_brightness); #ifdef ENABLE_PM_LOG if (!ret) pm_history_save(PM_LOG_LCD_DIM, get_pm_cur_state()); diff --git a/plugins/tv/display/device-interface.c b/plugins/tv/display/device-interface.c index a136a0e1..edba4322 100644 --- a/plugins/tv/display/device-interface.c +++ b/plugins/tv/display/device-interface.c @@ -268,8 +268,15 @@ static int backlight_off(enum device_flags flags) static int backlight_dim(void) { int ret; + int dim_brightness; - ret = backlight_ops.set_brightness(PM_DIM_BRIGHTNESS); + ret = vconf_get_int(VCONFKEY_SETAPPL_LCD_DIM_BRIGHTNESS, &dim_brightness); + if (ret < 0) { + _E("Failed to get vconf value for VCONFKEY_SETAPPL_LCD_DIM_BRIGHTNESS: %d", vconf_get_ext_errno()); + return ret; + } + + ret = backlight_ops.set_brightness(dim_brightness); #ifdef ENABLE_PM_LOG if (!ret) pm_history_save(PM_LOG_LCD_DIM, get_pm_cur_state()); diff --git a/plugins/wearable/display/device-interface.c b/plugins/wearable/display/device-interface.c index e859f29c..002691c0 100644 --- a/plugins/wearable/display/device-interface.c +++ b/plugins/wearable/display/device-interface.c @@ -279,8 +279,15 @@ static int backlight_off(enum device_flags flags) static int backlight_dim(void) { int ret; + int dim_brightness; - ret = backlight_ops.set_brightness(PM_DIM_BRIGHTNESS); + ret = vconf_get_int(VCONFKEY_SETAPPL_LCD_DIM_BRIGHTNESS, &dim_brightness); + if (ret < 0) { + _E("Failed to get vconf value for VCONFKEY_SETAPPL_LCD_DIM_BRIGHTNESS: %d", vconf_get_ext_errno()); + return ret; + } + + ret = backlight_ops.set_brightness(dim_brightness); #ifdef ENABLE_PM_LOG if (!ret) pm_history_save(PM_LOG_LCD_DIM, get_pm_cur_state());