From 103ce1ed2b7ee21b038255ec583d3d346baa982c Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Wed, 24 Jul 2019 16:13:33 +0900 Subject: [PATCH] Prelaunch default assistant when prelaunch_mode is set Change-Id: I00fe4121f9e4f4c18e4c5cc4dc33f859801f8b79 --- src/multi_assistant_service.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/multi_assistant_service.c b/src/multi_assistant_service.c index d945d5e..0f6511a 100644 --- a/src/multi_assistant_service.c +++ b/src/multi_assistant_service.c @@ -38,6 +38,8 @@ static const char *g_current_lang = "en_US"; #define MULTI_ASSISTANT_SETTINGS_ACTIVATED "db/multi-assistant/activated" +#define WAKEUP_SETTINGS_KEY_DEFAULT_ASSISTANT_APPID "db/multi-assistant/default_assistant_appid" +#define WAKEUP_SETTINGS_KEY_PRELAUNCH_MODE "db/multi-assistant/prelaunch_mode" #define MAX_MACLIENT_INFO_NUM 16 #define MAX_WAKEUP_WORDS_NUM 255 @@ -585,6 +587,20 @@ static int init_wakeup(void) vconf_notify_key_changed(MULTI_ASSISTANT_SETTINGS_ACTIVATED, mas_active_state_changed_cb, NULL); } + /* CHECK NEEDED : should the code segment below and activation logic above be moved to wakeup manger? */ + int prelaunch_mode; + int res = vconf_get_bool(WAKEUP_SETTINGS_KEY_PRELAUNCH_MODE, &prelaunch_mode); + if (0 == res && 0 != prelaunch_mode) { + char *vconf_str; + vconf_str = vconf_get_str(WAKEUP_SETTINGS_KEY_DEFAULT_ASSISTANT_APPID); + if (vconf_str) { + MAS_LOGD("prelaunching default_assistant_appid : %s", vconf_str); + mas_launch_client_by_appid(vconf_str, CLIENT_LAUNCH_MODE_PRELAUNCH); + free(vconf_str); + vconf_str = NULL; + } + } + return 0; } -- 2.7.4