diff options
author | Youngjae Cho <y0.cho@samsung.com> | 2020-05-22 14:02:24 +0900 |
---|---|---|
committer | Youngjae Cho <y0.cho@samsung.com> | 2020-05-22 14:19:31 +0900 |
commit | 578d9b248d76efe5c3f92b8ad8a37c5951f358aa (patch) | |
tree | 7cdef0888591520b21d03acfa3d282167daddef3 | |
parent | cc3ee05b37a4a9fd8d604adbc0d83d3e23a76ceb (diff) | |
download | deviced-578d9b248d76efe5c3f92b8ad8a37c5951f358aa.tar.gz deviced-578d9b248d76efe5c3f92b8ad8a37c5951f358aa.tar.bz2 deviced-578d9b248d76efe5c3f92b8ad8a37c5951f358aa.zip |
Fix not to reset timer by 7 seconds by custom_lcdon() during tutorial
custom_lcdon() resets normal timeout by 7 seconds. This method is
called when, for example, wrist-up or notification occurs. But during
tutorial, fixed it not to reset timeout timer by fixed 7 seconds, but
to reset the value of setting timeout.
Change-Id: Id15e55bcdfea8779547f600781a4d0035d5fdf8f
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
-rw-r--r-- | plugins/wearable/display/core.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/plugins/wearable/display/core.c b/plugins/wearable/display/core.c index c2abdbba..c0e58cef 100644 --- a/plugins/wearable/display/core.c +++ b/plugins/wearable/display/core.c @@ -63,6 +63,10 @@ #define DISPLAY_CONF_FILE "/etc/deviced/display.conf" +#ifndef VCONFKEY_HOMESCREEN_TUTORIAL_OOBE_ENABLED +#define VCONFKEY_HOMESCREEN_TUTORIAL_OOBE_ENABLED "db/private/com.samsung.w-home/tutorial_oobe_enabled" +#endif + /** * @addtogroup POWER_MANAGER * @{ @@ -1244,6 +1248,8 @@ static gboolean timer_refresh_cb(gpointer data) int custom_lcdon(int timeout) { struct state *st; + int ret, update; + int tutorial = 0; if (timeout <= 0) return -EINVAL; @@ -1251,8 +1257,18 @@ int custom_lcdon(int timeout) if (check_lcd_is_on() == false) lcd_on_direct(LCD_ON_BY_GESTURE); - _I("Custom lcd on timeout(%d ms).", timeout); - if (set_custom_lcdon_timeout(timeout) == true) + /* Exceptional case: + * During tutorial, reset timeout by default timeout, not the given timeout */ + ret = vconf_get_int(VCONFKEY_HOMESCREEN_TUTORIAL_OOBE_ENABLED, &tutorial); + if (ret == 0 && tutorial) { + _D("During tutorial, reset timeout to default timeout."); + update = set_custom_lcdon_timeout(0); + } else { + _D("Custom lcd on timeout %dms.", timeout); + update = set_custom_lcdon_timeout(timeout); + } + + if (update) update_display_time(); /* state transition */ @@ -1264,7 +1280,8 @@ int custom_lcdon(int timeout) if (st->action) st->action(st->timeout); - g_idle_add(timer_refresh_cb, NULL); + if (!tutorial) + g_idle_add(timer_refresh_cb, NULL); return 0; } |