diff options
author | Jiyoung Yun <jy910.yun@samsung.com> | 2015-05-04 16:37:14 +0900 |
---|---|---|
committer | Jiyoung Yun <jy910.yun@samsung.com> | 2015-05-06 18:43:47 +0900 |
commit | 901f49671304c989751173d8e0d6529f8e4c221c (patch) | |
tree | 9d795a7e0c1408cc93efaa91f6651658d9e1d84a | |
parent | b1ad68f3e3f726353e127520d170fa5a9ac4fbfc (diff) | |
download | deviced-901f49671304c989751173d8e0d6529f8e4c221c.tar.gz deviced-901f49671304c989751173d8e0d6529f8e4c221c.tar.bz2 deviced-901f49671304c989751173d8e0d6529f8e4c221c.zip |
display: Change the default lcd timeout time to 30s (30000s->30s)
Only mobile profile will need this operation.
We should redesign how to manage other profile by one code.
Change-Id: Ib6ab0256ed0692e3ea0f0e949fffd12fd4247315
Signed-off-by: Jiyoung Yun <jy910.yun@samsung.com>
-rwxr-xr-x | scripts/deviced-pre.sh | 2 | ||||
-rw-r--r-- | src/display/core.c | 19 | ||||
-rw-r--r-- | src/display/core.h | 4 | ||||
-rw-r--r-- | src/display/setting.c | 16 | ||||
-rw-r--r-- | src/display/setting.h | 6 |
5 files changed, 12 insertions, 35 deletions
diff --git a/scripts/deviced-pre.sh b/scripts/deviced-pre.sh index 0238c05f..cc75b707 100755 --- a/scripts/deviced-pre.sh +++ b/scripts/deviced-pre.sh @@ -31,7 +31,5 @@ done echo "PM_TOUCHSCREEN=$DEV_TOUCHSCREEN" >> $DEVICED_ENV_F echo "PM_TOUCHKEY=$DEV_TOUCHKEY" >> $DEVICED_ENV_F -echo "PM_TO_NORMAL=30000" >> $DEVICED_ENV_F -echo "PM_TO_LCDDIM=5000" >> $DEVICED_ENV_F echo "PM_SYS_DIMBRT=0" >> $DEVICED_ENV_F diff --git a/src/display/core.c b/src/display/core.c index 6212f323..2aa8260d 100644 --- a/src/display/core.c +++ b/src/display/core.c @@ -595,17 +595,11 @@ static int get_lcd_timeout_from_settings(void) { int i; int val = 0; - int ret = -1; - char *buf; for (i = 0; i < S_END; i++) { switch (states[i].state) { case S_NORMAL: - ret = get_run_timeout(&val); - if (ret != 0) { - buf = getenv("PM_TO_NORMAL"); - val = (buf ? atoi(buf) : DEFAULT_NORMAL_TIMEOUT); - } + get_run_timeout(&val); break; case S_LCDDIM: get_dim_timeout(&val); @@ -667,12 +661,7 @@ static void update_display_time(void) } /* default setting */ - ret = get_run_timeout(&run_timeout); - if (ret < 0 || run_timeout < 0) { - _E("Can not get run timeout. set default %d ms", - DEFAULT_NORMAL_TIMEOUT); - run_timeout = DEFAULT_NORMAL_TIMEOUT; - } + get_run_timeout(&run_timeout); /* for sdk * if the run_timeout is zero, it regards AlwaysOn state @@ -2269,8 +2258,8 @@ static void display_init(void *data) timeout = states[S_NORMAL].timeout; /* check minimun lcd on time */ - if (timeout < DEFAULT_NORMAL_TIMEOUT) - timeout = DEFAULT_NORMAL_TIMEOUT; + if (timeout < SEC_TO_MSEC(DEFAULT_NORMAL_TIMEOUT)) + timeout = SEC_TO_MSEC(DEFAULT_NORMAL_TIMEOUT); reset_timeout(timeout); status = DEVICE_OPS_STATUS_START; diff --git a/src/display/core.h b/src/display/core.h index 2fe42f49..ed12c773 100644 --- a/src/display/core.h +++ b/src/display/core.h @@ -43,9 +43,7 @@ #define PWROFF_FLAG 0x00004000 #define DIMSTAY_FLAG 0x00008000 -#define DEFAULT_NORMAL_TIMEOUT 30000 -#define DEFAULT_DIM_TIMEOUT 5000 -#define DEFAULT_OFF_TIMEOUT 1000 +#define DEFAULT_NORMAL_TIMEOUT 30 #define MASK32 0xffffffff diff --git a/src/display/setting.c b/src/display/setting.c index 4fc32b82..731a2a04 100644 --- a/src/display/setting.c +++ b/src/display/setting.c @@ -109,13 +109,13 @@ int get_setting_brightness(int *level) return vconf_get_int(VCONFKEY_SETAPPL_LCD_BRIGHTNESS, level); } -int get_dim_timeout(int *dim_timeout) +void get_dim_timeout(int *dim_timeout) { int vconf_timeout, on_timeout, val, ret; if (custom_dim_timeout > 0) { *dim_timeout = custom_dim_timeout; - return 0; + return; } ret = vconf_get_int(setting_keys[SETTING_TO_NORMAL], &vconf_timeout); @@ -134,11 +134,9 @@ int get_dim_timeout(int *dim_timeout) val = LCD_MAX_DIM_TIMEOUT; *dim_timeout = val; - - return 0; } -int get_run_timeout(int *timeout) +void get_run_timeout(int *timeout) { int dim_timeout = -1; int vconf_timeout = -1; @@ -147,7 +145,7 @@ int get_run_timeout(int *timeout) if (custom_normal_timeout > 0) { *timeout = custom_normal_timeout; - return 0; + return; } ret = vconf_get_int(setting_keys[SETTING_TO_NORMAL], &vconf_timeout); @@ -161,17 +159,13 @@ int get_run_timeout(int *timeout) else on_timeout = SEC_TO_MSEC(vconf_timeout); - if (on_timeout < 0) - return -ERANGE; - if (on_timeout == 0) { *timeout = on_timeout; - return 0; + return; } get_dim_timeout(&dim_timeout); *timeout = on_timeout - dim_timeout; - return 0; } int set_custom_lcdon_timeout(int timeout) diff --git a/src/display/setting.h b/src/display/setting.h index dd0133dc..93795be2 100644 --- a/src/display/setting.h +++ b/src/display/setting.h @@ -70,18 +70,16 @@ extern int exit_setting(); * * @internal * @param[out] timeout timeout variable pointer - * @return 0 : success, -1 : error */ -extern int get_run_timeout(int *timeout); +void get_run_timeout(int *timeout); /* * get LCD dim state timeout from environment variable. * * @internal * @param[out] dim_timeout timeout variable pointer - * @return 0 : success, negative value : error */ -extern int get_dim_timeout(int *dim_timeout); +void get_dim_timeout(int *dim_timeout); /* * get USB connection status from SLP-setting SLP_SETTING_USB_STATUS * |