display: Change the default lcd timeout time to 30s (30000s->30s) 61/38961/5
authorJiyoung Yun <jy910.yun@samsung.com>
Mon, 4 May 2015 07:37:14 +0000 (16:37 +0900)
committerJiyoung Yun <jy910.yun@samsung.com>
Wed, 6 May 2015 09:43:47 +0000 (18:43 +0900)
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>
scripts/deviced-pre.sh
src/display/core.c
src/display/core.h
src/display/setting.c
src/display/setting.h

index 0238c05..cc75b70 100755 (executable)
@@ -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
 
index 6212f32..2aa8260 100644 (file)
@@ -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;
index 2fe42f4..ed12c77 100644 (file)
@@ -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
 
index 4fc32b8..731a2a0 100644 (file)
@@ -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)
index dd0133d..93795be 100644 (file)
@@ -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
  *