diff options
author | sh.pi <sh.pi@samsung.com> | 2013-04-18 15:23:55 +0900 |
---|---|---|
committer | sh.pi <sh.pi@samsung.com> | 2013-04-18 15:23:55 +0900 |
commit | 8ef42ca0d86a4f9001550bf3507c689411d838a2 (patch) | |
tree | ca4f4eec736909f5ab1f6699987bba947e1801fc /pm_llinterface.c | |
parent | 75cfc5f5752cd2d69fb2b81d6f21b04eeb55b15e (diff) | |
download | power-manager-8ef42ca0d86a4f9001550bf3507c689411d838a2.tar.gz power-manager-8ef42ca0d86a4f9001550bf3507c689411d838a2.tar.bz2 power-manager-8ef42ca0d86a4f9001550bf3507c689411d838a2.zip |
Update vconf key for current brt in every case.
OSP wants to know about the time of brightness changed.
but there's bug that vconf of brightness is not updated for every case.
then fix the bug.
Diffstat (limited to 'pm_llinterface.c')
-rw-r--r-- | pm_llinterface.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/pm_llinterface.c b/pm_llinterface.c index b9df190..8482b65 100644 --- a/pm_llinterface.c +++ b/pm_llinterface.c @@ -77,12 +77,24 @@ static int _bl_onoff(PMSys *p, int onoff) return device_set_property(DEVICE_TYPE_DISPLAY, cmd, onoff); } -static int _bl_brt(PMSys *p, int brightness) +static int _bl_brt(PMSys *p, int brt) { int cmd; + int ret; + int old_brt; + COMBINE_DISP_CMD(cmd, PROP_DISPLAY_BRIGHTNESS, DEFAULT_DISPLAY); - int ret = device_set_property(DEVICE_TYPE_DISPLAY, cmd, brightness); - LOGERR("set brightness %d,%d %d", DEFAULT_DISPLAY, brightness, ret); + ret = device_get_property(DEVICE_TYPE_DISPLAY, cmd, &old_brt); + + /* Update new brightness to vconf */ + if (!ret && (brt != old_brt)) + vconf_set_int(VCONFKEY_PM_CURRENT_BRIGHTNESS, brt); + + /* Update device brightness */ + ret = device_set_property(DEVICE_TYPE_DISPLAY, cmd, brt); + + LOGERR("set brightness %d,%d %d", DEFAULT_DISPLAY, brt, ret); + return ret; } @@ -245,14 +257,8 @@ int backlight_off() int backlight_dim() { int ret = 0; - int cmd; - int brightness; if (pmsys && pmsys->bl_brt) { - COMBINE_DISP_CMD(cmd, PROP_DISPLAY_BRIGHTNESS, DEFAULT_DISPLAY); - ret = device_get_property(DEVICE_TYPE_DISPLAY, cmd, &brightness); - if (!ret && pmsys->dim_brt != brightness) - vconf_set_int(VCONFKEY_PM_CURRENT_BRIGHTNESS, pmsys->dim_brt); ret = pmsys->bl_brt(pmsys, pmsys->dim_brt); } return ret; |