display: Support dim brightness setting 50/315250/1 accepted/tizen/7.0/unified/20240730.133927
authorYunhee Seo <yuni.seo@samsung.com>
Mon, 29 Jul 2024 05:11:56 +0000 (14:11 +0900)
committerYunhee Seo <yuni.seo@samsung.com>
Mon, 29 Jul 2024 05:11:56 +0000 (14:11 +0900)
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 <yuni.seo@samsung.com>
plugins/iot-headed/display/device-interface.c
plugins/mobile/display/device-interface.c
plugins/tv/display/device-interface.c
plugins/wearable/display/device-interface.c

index 1d716b7cc21a5d9917e5db270242dd9d5476434f..8e9a64085e54138aa64ea9a1769bb8db932edc59 100644 (file)
@@ -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());
index f35f24d17f79d675de3f5ffe83037534b2b0d553..66d8e92393c8a0b5589d80a41f5501bc973836e8 100644 (file)
@@ -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());
index a136a0e1f9b892e88ff81a884e41d786b12c24da..edba4322f8da696e627ed4bb3017fbd4a9965f8c 100644 (file)
@@ -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());
index e859f29c7b47b8db5eaeae3049c7f8f8033ff27d..002691c074fa64802eef1d6092e78b877985e49a 100644 (file)
@@ -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());