From: Ji-hoon Lee Date: Wed, 10 Oct 2018 08:02:47 +0000 (+0900) Subject: A temporary replacement for ma_request_speech_data() logic X-Git-Tag: submit/tizen/20181204.065424~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bb30674dcd03a2237d366ae1f1d67d1b96a24d20;p=platform%2Fcore%2Fuifw%2Fwakeup-engine-default.git A temporary replacement for ma_request_speech_data() logic The MA client should ask for speech data when it's ready, but currently such a call like "ma_request_speech_data()" has not been prepared yet. Thus, as a workaround solution, we add a timer to spend enough time until the client receives service state ready message from the voice control engine and is able to send speech data to it. Change-Id: I6dd13a9146a7455b219b796301d4b803d05b9095 --- diff --git a/src/multi_assistant_service.c b/src/multi_assistant_service.c index 078a4da..4e8ef50 100644 --- a/src/multi_assistant_service.c +++ b/src/multi_assistant_service.c @@ -186,6 +186,24 @@ ma_client_s* ma_client_find_by_pid(int pid) return NULL; } +Eina_Bool __request_speech_data_timer(void *data) +{ + MAS_LOGD("[ENTER]"); + + int pid = (int)(data); + char appid[MAX_APPID_LEN] = {'\0',}; + if (AUL_R_OK == aul_app_get_appid_bypid(pid, appid, sizeof(appid))) { + appid[MAX_APPID_LEN - 1] = '\0'; + if (strncmp(g_launching_maclient_appid, appid, MAX_APPID_LEN) == 0) { + g_launching_maclient_appid[0] = '\0'; + mas_client_request_speech_data(pid); + } + } + + MAS_LOGD("END"); + return EINA_FALSE; +} + int mas_client_initialize(int pid) { MAS_LOGD("[Enter] pid(%d)", pid); @@ -224,10 +242,7 @@ int mas_client_initialize(int pid) /* Since the ma_request_speech_data() is not available, we will request speech data here. Need to remove below code when ma_request_speech_data() get implemented. */ - if (0 == strncmp(g_launching_maclient_appid, appid, MAX_APPID_LEN)) { - g_launching_maclient_appid[0] = '\0'; - mas_client_request_speech_data(pid); - } + ecore_timer_add(3.0f, __request_speech_data_timer, (void*)(pid)); } }