From 78bfdad0e71474ec2b8725a947c7fd8d4f48e187 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Thu, 14 May 2020 13:49:50 +0900 Subject: [PATCH 01/16] Fix build errors Change-Id: I69e8d81808e4a7ddf984336151cfb3ea653a1765 --- packaging/org.tizen.multi-assistant-service.spec | 3 +++ plugins/wakeup-manager/src/wakeup_manager_wrapper.cpp | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/packaging/org.tizen.multi-assistant-service.spec b/packaging/org.tizen.multi-assistant-service.spec index 6ce5be6..99398c1 100644 --- a/packaging/org.tizen.multi-assistant-service.spec +++ b/packaging/org.tizen.multi-assistant-service.spec @@ -52,6 +52,9 @@ LDFLAGS="$LDFLAGS -Wl,-z -Wl,nodelete" export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE" %endif +export CFLAGS+=" -Wno-format-truncation -Wno-stringop-truncation -Wno-format-overflow -Wno-stringop-overflow" +export CXXFLAGS+=" -Wno-format-truncation -Wno-stringop-truncation -Wno-format-overflow -Wno-stringop-overflow" + export LDFLAGS %cmake \ -DCMAKE_INSTALL_PREFIX=%{_appdir} \ diff --git a/plugins/wakeup-manager/src/wakeup_manager_wrapper.cpp b/plugins/wakeup-manager/src/wakeup_manager_wrapper.cpp index 6e30433..461eb5b 100644 --- a/plugins/wakeup-manager/src/wakeup_manager_wrapper.cpp +++ b/plugins/wakeup-manager/src/wakeup_manager_wrapper.cpp @@ -229,7 +229,7 @@ int wakeup_manager_set_default_assistant(const char* appid) MWR_LOGD("[ENTER]"); if (NULL == appid) { - MWR_LOGD("[ERROR] Parameter is invalid, appid(%s)", appid); + MWR_LOGD("[ERROR] Parameter is NULL"); return -1; } @@ -261,7 +261,7 @@ int wakeup_manager_set_language(const char* language) MWR_LOGD("[ENTER]"); if (NULL == language) { - MWR_LOGD("[ERROR] Parameter is invalid, language(%s)", language); + MWR_LOGD("[ERROR] Parameter is NULL"); return -1; } @@ -307,7 +307,7 @@ int wakeup_manager_update_voice_feedback_state(const char* appid, int state) string appid_string; if (NULL == appid) { - MWR_LOGD("[ERROR] Parameter is invalid, appid(%s)", appid); + MWR_LOGD("[ERROR] Parameter is NULL"); } else { appid_string = appid; } @@ -344,7 +344,7 @@ int wakeup_manager_set_background_volume(const char* appid, double ratio) string appid_string; if (NULL == appid) { - MWR_LOGD("[ERROR] Parameter is invalid, appid(%s)", appid); + MWR_LOGD("[ERROR] Parameter is NULL"); } else { appid_string = appid; } @@ -362,7 +362,7 @@ int wakeup_manager_update_recognition_result(const char* appid, int result) string appid_string; if (NULL == appid) { - MWR_LOGD("[ERROR] Parameter is invalid, appid(%s)", appid); + MWR_LOGD("[ERROR] Parameter is NULL"); } else { appid_string = appid; } -- 2.7.4 From 2955e711f224e750830752f03e6b0c62a18f83ed Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Thu, 14 May 2020 15:32:17 +0900 Subject: [PATCH 02/16] Feed utterance audio only to the selected wakeup engine Change-Id: I0ca917128e28ab77d5a37b033ecd62ea8d0d4123 --- plugins/wakeup-manager/inc/wakeup_engine_manager.h | 1 + plugins/wakeup-manager/src/wakeup_engine_manager.cpp | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/plugins/wakeup-manager/inc/wakeup_engine_manager.h b/plugins/wakeup-manager/inc/wakeup_engine_manager.h index fb668a9..4c196eb 100644 --- a/plugins/wakeup-manager/inc/wakeup_engine_manager.h +++ b/plugins/wakeup-manager/inc/wakeup_engine_manager.h @@ -206,6 +206,7 @@ private: thread mStreamingThread; atomic_bool mStopStreamingThread{false}; + wakeup_manager_state_e mWakeupManagerState{WAKEUP_MANAGER_STATE_INACTIVE}; bool mWakeWordAudioRequired{false}; }; diff --git a/plugins/wakeup-manager/src/wakeup_engine_manager.cpp b/plugins/wakeup-manager/src/wakeup_engine_manager.cpp index aa31ab7..d9181dc 100644 --- a/plugins/wakeup-manager/src/wakeup_engine_manager.cpp +++ b/plugins/wakeup-manager/src/wakeup_engine_manager.cpp @@ -510,6 +510,7 @@ void CWakeupEngineManager::update_manager_state(wakeup_manager_state_e state) } } } + mWakeupManagerState = state; } void CWakeupEngineManager::update_recognition_result(string appid, int result) @@ -598,9 +599,19 @@ void CWakeupEngineManager::engine_feed_audio_data(long time, void* data, int len info.audio_data_require_status && info.interface.feed_audio_data) { try { - int ret = info.interface.feed_audio_data(time, data, len); - if (0 != ret) { - LOGE("[ERROR] Fail to feed speech data, ret(%d) : %s", ret, info.engine_name.c_str()); + bool filtered_out = false; + /* After a wakeup event, wakeup engines other than the selected one + does not need to receive audio data. */ + if (WAKEUP_MANAGER_STATE_UTTERANCE == mWakeupManagerState) { + if (mSelectedEngine && &info != mSelectedEngine) { + filtered_out = true; + } + } + if (!filtered_out) { + int ret = info.interface.feed_audio_data(time, data, len); + if (0 != ret) { + LOGE("[ERROR] Fail to feed speech data, ret(%d) : %s", ret, info.engine_name.c_str()); + } } } catch (const std::exception& e) { MWR_LOGE("[ERROR] wakeup engine %s threw exception : %s", -- 2.7.4 From a989fa3ec68d7c0e1c898f778a9b8ebcce26164e Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Thu, 14 May 2020 15:33:08 +0900 Subject: [PATCH 03/16] Bump version to 0.2.32 Change-Id: I623e4745dd7c1834ad961403664910a7e1198f97 --- org.tizen.multi-assistant-service.xml | 2 +- packaging/org.tizen.multi-assistant-service.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/org.tizen.multi-assistant-service.xml b/org.tizen.multi-assistant-service.xml index 418edad..7c451d8 100644 --- a/org.tizen.multi-assistant-service.xml +++ b/org.tizen.multi-assistant-service.xml @@ -1,5 +1,5 @@ - + Won Nam Jang Sooyeon Kim diff --git a/packaging/org.tizen.multi-assistant-service.spec b/packaging/org.tizen.multi-assistant-service.spec index 99398c1..b41d4a3 100644 --- a/packaging/org.tizen.multi-assistant-service.spec +++ b/packaging/org.tizen.multi-assistant-service.spec @@ -1,6 +1,6 @@ Name: org.tizen.multi-assistant-service Summary: Multi assistant service -Version: 0.2.31 +Version: 0.2.32 Release: 1 Group: Graphics & UI Framework/Voice Framework License: Flora-1.1 -- 2.7.4 From 32c8acce0dccfbf1e5a1bf2667c42635b1edd584 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Wed, 20 May 2020 18:15:38 +0900 Subject: [PATCH 04/16] Add logs for checking initialization process Change-Id: I9647f91f1d8caf5215d1cde0849c538c80b3b2d6 --- src/main.cpp | 3 +++ src/service_main.cpp | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index c7e4dae..33129a9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -27,11 +27,13 @@ CServiceMain g_service_main{g_application_manager_aul, g_preference_manager_vcon static bool service_app_create(void *data) { + LOGI(""); return g_service_main.app_create(data); } static void service_app_terminate(void *data) { + LOGI(""); return g_service_main.app_terminate(data); } @@ -64,6 +66,7 @@ static void service_app_low_memory(app_event_info_h event_info, void *user_data) int main(int argc, char* argv[]) { + LOGI("Main function starts"); char ad[50] = {0, }; service_app_lifecycle_callback_s event_callback; app_event_handler_h handlers[5] = {NULL, }; diff --git a/src/service_main.cpp b/src/service_main.cpp index a617088..966c336 100644 --- a/src/service_main.cpp +++ b/src/service_main.cpp @@ -1312,7 +1312,7 @@ static void _package_manager_event_cb(const char *type, const char *package, pac bool CServiceMain::app_create(void *data) { // Todo: add your code here. - MAS_LOGD("[Enter] Service app create"); + MAS_LOGI("[Enter] Service app create"); g_service_main = this; @@ -1359,6 +1359,7 @@ bool CServiceMain::app_create(void *data) } } + MAS_LOGI("[END]"); return true; } -- 2.7.4 From 3d9c1eef9bb957f237d59ef52cb050138aca14d2 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Thu, 21 May 2020 16:49:49 +0900 Subject: [PATCH 05/16] Add log messages for checking startup process Change-Id: I79a0d20bed3ee46f81e8a6b30f6df821c5838f13 --- src/multi_assistant_service.c | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/src/multi_assistant_service.c b/src/multi_assistant_service.c index fcbd186..a449555 100644 --- a/src/multi_assistant_service.c +++ b/src/multi_assistant_service.c @@ -65,6 +65,26 @@ static ma_voice_key_status_e g_last_voice_key_status = MA_VOICE_KEY_STATUS_RELEA /* client list */ static GSList* g_client_list = NULL; +#ifdef ENABLE_FILE_LOG +static void file_log(const char* s) +{ + FILE *fp = fopen("/tmp/maservice_log.txt", "a"); + if (fp) { + char time_buf[96] = {0}; + + struct timespec ts; + clock_gettime(CLOCK_REALTIME, &ts); + const time_t tt = ts.tv_sec; + struct tm *const ptm = localtime(&tt); + + strftime(time_buf, sizeof(time_buf), "%m-%d %H:%M:%S", ptm); + fprintf(fp, "[%s] %s\n", time_buf, s); + fclose(fp); + } + fflush(fp); +} +#endif + int ma_client_create(ma_client_s *info) { if (NULL == info) { @@ -1505,8 +1525,10 @@ static void _package_manager_event_cb(const char *type, const char *package, pac bool service_app_create(void *data) { // Todo: add your code here. - - MAS_LOGD("[Enter] Service app create"); + MAS_LOGI("[ENTER] Service app create"); +#ifdef ENABLE_FILE_LOG + file_log("[ENTER] Service app create"); +#endif if (0 != init_wakeup()) { MAS_LOGE("Fail to init wakeup service"); @@ -1529,6 +1551,10 @@ bool service_app_create(void *data) } } +#ifdef ENABLE_FILE_LOG + file_log("[END] Service app create"); +#endif + MAS_LOGI("[END] Service app create"); return true; } @@ -1580,6 +1606,11 @@ service_app_low_memory(app_event_info_h event_info, void *user_data) int main(int argc, char* argv[]) { + LOGI("Main function starts"); +#ifdef ENABLE_FILE_LOG + file_log("Main function starts"); +#endif + char ad[50] = {0,}; service_app_lifecycle_callback_s event_callback; app_event_handler_h handlers[5] = {NULL, }; -- 2.7.4 From add5d3262352683c10339a1eb5cf9af47597dfda Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Mon, 25 May 2020 08:46:11 +0900 Subject: [PATCH 06/16] Use app_manager_is_running() for checking process existence Change-Id: Ibe88a55dc15f38cd43a51667fc19a1b34eabe0c8 --- src/multi_assistant_service.c | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/src/multi_assistant_service.c b/src/multi_assistant_service.c index a449555..8ae416a 100644 --- a/src/multi_assistant_service.c +++ b/src/multi_assistant_service.c @@ -923,13 +923,17 @@ int mas_get_client_pid_by_appid(const char *appid) } } - int status = aul_app_get_status_bypid(ret); - if (-1 != ret && 0 > status) { - MAS_LOGE("The PID for %s was %d, but it seems to be terminated : %d", - (appid ? appid : "NULL"), ret, status); - mas_client_deinitialize(ret); - ret = -1; +#ifdef CHECK_APP_IS_RUNNING + bool running = false; + if (appid && 0 == app_manager_is_running(appid, &running)) { + if (!running) { + MAS_LOGE("The PID for %s was %d, but it seems to be terminated : %d", + (appid ? appid : "NULL"), ret, running); + mas_client_deinitialize(ret); + ret = -1; + } } +#endif return ret; } @@ -944,13 +948,17 @@ const char* mas_get_client_appid_by_pid(int pid) ret = client->appid; } - int status = aul_app_get_status_bypid(pid); - if (-1 != ret && 0 > status) { - MAS_LOGE("The appid for %d was %s, but it seems to be terminated : %d", - pid, (ret ? ret : "NULL"), status); - mas_client_deinitialize(pid); - ret = NULL; +#ifdef CHECK_APP_IS_RUNNING + bool running = false; + if (ret && 0 == app_manager_is_running(ret, &running)) { + if (!running) { + MAS_LOGE("The appid for %d was %s, but it seems to be terminated : %d", + pid, (ret ? ret : "NULL"), running); + mas_client_deinitialize(pid); + ret = NULL; + } } +#endif return ret; } -- 2.7.4 From dc9ed53e4333130b50c71ece3f16b7222056e252 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Mon, 25 May 2020 09:11:56 +0900 Subject: [PATCH 07/16] Bump version to 0.2.33 Change-Id: I10526ccabc9ffd6fb37aea844a28c95c596e9d93 --- org.tizen.multi-assistant-service.xml | 2 +- packaging/org.tizen.multi-assistant-service.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/org.tizen.multi-assistant-service.xml b/org.tizen.multi-assistant-service.xml index 7c451d8..4d64d60 100644 --- a/org.tizen.multi-assistant-service.xml +++ b/org.tizen.multi-assistant-service.xml @@ -1,5 +1,5 @@ - + Won Nam Jang Sooyeon Kim diff --git a/packaging/org.tizen.multi-assistant-service.spec b/packaging/org.tizen.multi-assistant-service.spec index b41d4a3..31eed78 100644 --- a/packaging/org.tizen.multi-assistant-service.spec +++ b/packaging/org.tizen.multi-assistant-service.spec @@ -1,6 +1,6 @@ Name: org.tizen.multi-assistant-service Summary: Multi assistant service -Version: 0.2.32 +Version: 0.2.33 Release: 1 Group: Graphics & UI Framework/Voice Framework License: Flora-1.1 -- 2.7.4 From 534d5769bfa1346f76a3041eda3fd6f3d8bcebcc Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Mon, 25 May 2020 21:49:30 +0900 Subject: [PATCH 08/16] Add NULL check when prelaunching default assistant Change-Id: Id8d6fa2323000101f4edd8ce33ab99d1bb8cae29 --- src/service_main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/service_main.cpp b/src/service_main.cpp index 966c336..4dda21b 100644 --- a/src/service_main.cpp +++ b/src/service_main.cpp @@ -950,7 +950,8 @@ int CServiceMain::prelaunch_default_assistant() if (prelaunch_mode && *prelaunch_mode) { const char *default_assistant = NULL; if (0 == mServicePlugin.get_default_assistant(&default_assistant)) { - if (!(mApplicationManager.is_application_running(default_assistant))) { + if (default_assistant && + !(mApplicationManager.is_application_running(default_assistant))) { MAS_LOGD("prelaunching default_assistant_appid : %s", default_assistant); launch_client_by_appid(default_assistant, CLIENT_LAUNCH_MODE_PRELAUNCH); } -- 2.7.4 From 6b0de0db125800e4958f95b863452b1a0e914389 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Mon, 25 May 2020 21:50:03 +0900 Subject: [PATCH 09/16] Bump version to 0.2.32 Change-Id: I6ffb0f3d69404b37a450e6c51d0cad1351acb73d --- org.tizen.multi-assistant-service.xml | 2 +- packaging/org.tizen.multi-assistant-service.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/org.tizen.multi-assistant-service.xml b/org.tizen.multi-assistant-service.xml index 418edad..7c451d8 100644 --- a/org.tizen.multi-assistant-service.xml +++ b/org.tizen.multi-assistant-service.xml @@ -1,5 +1,5 @@ - + Won Nam Jang Sooyeon Kim diff --git a/packaging/org.tizen.multi-assistant-service.spec b/packaging/org.tizen.multi-assistant-service.spec index 89704e5..68165fa 100644 --- a/packaging/org.tizen.multi-assistant-service.spec +++ b/packaging/org.tizen.multi-assistant-service.spec @@ -1,6 +1,6 @@ Name: org.tizen.multi-assistant-service Summary: Multi assistant service -Version: 0.2.31 +Version: 0.2.32 Release: 1 Group: Graphics & UI Framework/Voice Framework License: Flora-1.1 -- 2.7.4 From 68e0b4f06b2c39decfa3d96d3d4cda89b380ad76 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Mon, 25 May 2020 11:35:05 +0900 Subject: [PATCH 10/16] Enable app_manager_is_running and add retry logic on failure Change-Id: I3f32c7e8ef93e96b1ca57276c89748e3f11e6e4a --- src/multi_assistant_service.c | 44 +++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/src/multi_assistant_service.c b/src/multi_assistant_service.c index 8ae416a..6438333 100644 --- a/src/multi_assistant_service.c +++ b/src/multi_assistant_service.c @@ -923,17 +923,21 @@ int mas_get_client_pid_by_appid(const char *appid) } } -#ifdef CHECK_APP_IS_RUNNING + int retry_num = 0; + bool succeeded = false; bool running = false; - if (appid && 0 == app_manager_is_running(appid, &running)) { - if (!running) { - MAS_LOGE("The PID for %s was %d, but it seems to be terminated : %d", - (appid ? appid : "NULL"), ret, running); - mas_client_deinitialize(ret); - ret = -1; - } + if (appid) { + do { + succeeded = (0 == app_manager_is_running(appid, &running)); + if (succeeded && !running) { + MAS_LOGE("The PID for %s was %d, but it seems to be terminated : %d", + (appid ? appid : "NULL"), ret, running); + mas_client_deinitialize(ret); + ret = -1; + } + if (!succeeded) usleep(10000); + } while(!succeeded && retry_num++ < 3); } -#endif return ret; } @@ -948,17 +952,21 @@ const char* mas_get_client_appid_by_pid(int pid) ret = client->appid; } -#ifdef CHECK_APP_IS_RUNNING + int retry_num = 0; + bool succeeded = false; bool running = false; - if (ret && 0 == app_manager_is_running(ret, &running)) { - if (!running) { - MAS_LOGE("The appid for %d was %s, but it seems to be terminated : %d", - pid, (ret ? ret : "NULL"), running); - mas_client_deinitialize(pid); - ret = NULL; - } + if (ret) { + do { + succeeded = (0 == app_manager_is_running(ret, &running)); + if (succeeded && !running) { + MAS_LOGE("The appid for %d was %s, but it seems to be terminated : %d", + pid, (ret ? ret : "NULL"), running); + mas_client_deinitialize(pid); + ret = NULL; + } + if (!succeeded) usleep(10000); + } while(!succeeded && retry_num++ < 3); } -#endif return ret; } -- 2.7.4 From 8703e44b952a5d8f9053fac74983b067829d9502 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Mon, 25 May 2020 12:03:24 +0900 Subject: [PATCH 11/16] Make sure uninstall completion event also restarts service Change-Id: I0349eeb25d3bf32c839c6eeb5ea566410b28e987 --- src/multi_assistant_service.c | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/src/multi_assistant_service.c b/src/multi_assistant_service.c index 6438333..9ed865e 100644 --- a/src/multi_assistant_service.c +++ b/src/multi_assistant_service.c @@ -1476,6 +1476,7 @@ static void _package_manager_event_cb(const char *type, const char *package, pac pkgmgrinfo_pkginfo_h handle = NULL; static bool in_progress = false; bool should_exit = false; + bool pkginfo_found = true; if (!package || !type) return; @@ -1486,7 +1487,8 @@ static void _package_manager_event_cb(const char *type, const char *package, pac return; if (PACKAGE_MANAGER_EVENT_STATE_STARTED != event_state && - PACKAGE_MANAGER_EVENT_STATE_COMPLETED != event_state) + PACKAGE_MANAGER_EVENT_STATE_COMPLETED != event_state && + PACKAGE_MANAGER_EVENT_STATE_FAILED != event_state) return; bool user = false; @@ -1500,16 +1502,28 @@ static void _package_manager_event_cb(const char *type, const char *package, pac ret = pkgmgrinfo_pkginfo_get_usr_pkginfo (package, uid, &handle); if (ret != PMINFO_R_OK || NULL == handle) { LOGW("Failed to call pkgmgrinfo_pkginfo_get_pkginfo & get_usr_pkginfo(\"%s\",~) returned %d, uid : %d", package, ret, getuid ()); - return; + pkginfo_found = false; } } - if (user) { - /* Try to get in user packages */ - pkgmgrinfo_appinfo_get_usr_list(handle, PMINFO_ALL_APP, pkg_app_list_cb, (void *)&ret, uid); - } else { - /* Try to get in global packages */ - pkgmgrinfo_appinfo_get_list(handle, PMINFO_ALL_APP, pkg_app_list_cb, (void *)&ret); + if (pkginfo_found) { + if (user) { + /* Try to get in user packages */ + pkgmgrinfo_appinfo_get_usr_list(handle, PMINFO_ALL_APP, pkg_app_list_cb, (void *)&ret, uid); + } else { + /* Try to get in global packages */ + pkgmgrinfo_appinfo_get_list(handle, PMINFO_ALL_APP, pkg_app_list_cb, (void *)&ret); + } + } else { + /* Even if we failed acquiring the pkginfo, proceed if we're uninstalling + since at the time of uninstall completion, pkginfo would not exist */ + if (in_progress) { + if (PACKAGE_MANAGER_EVENT_TYPE_UNINSTALL == event_type && + (PACKAGE_MANAGER_EVENT_STATE_COMPLETED == event_state || + PACKAGE_MANAGER_EVENT_STATE_FAILED == event_state)) { + ret = 1; + } + } } if (1 == ret) { if (PACKAGE_MANAGER_EVENT_STATE_STARTED == event_state) { @@ -1518,8 +1532,10 @@ static void _package_manager_event_cb(const char *type, const char *package, pac in_progress = true; deinit_plugin(); } - } else if (PACKAGE_MANAGER_EVENT_STATE_COMPLETED == event_state) { - LOGI("processing PACKAGE_MANAGER_EVENT_STATE_COMPLETED event : %d", event_type); + } else if (PACKAGE_MANAGER_EVENT_STATE_COMPLETED == event_state || + PACKAGE_MANAGER_EVENT_STATE_FAILED == event_state) { + LOGI("processing PACKAGE_MANAGER_EVENT_STATE_COMPLETED/FAILED event : %d %d", + event_state, event_type); if (false == in_progress) { deinit_plugin(); } @@ -1528,7 +1544,7 @@ static void _package_manager_event_cb(const char *type, const char *package, pac } } - pkgmgrinfo_pkginfo_destroy_pkginfo(handle); + if (handle) pkgmgrinfo_pkginfo_destroy_pkginfo(handle); if (should_exit) { LOGI("Now restarting multi-assistant-service for reloading updated modules"); -- 2.7.4 From 8a540b3b1022845c79abc1dd336e24fece7f22e0 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Wed, 27 May 2020 13:35:16 +0900 Subject: [PATCH 12/16] Bump version to 0.2.34 Change-Id: I63ad89fe501034375b402916d6ec1ae36fdcaa3c --- org.tizen.multi-assistant-service.xml | 2 +- packaging/org.tizen.multi-assistant-service.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/org.tizen.multi-assistant-service.xml b/org.tizen.multi-assistant-service.xml index 4d64d60..db96b45 100644 --- a/org.tizen.multi-assistant-service.xml +++ b/org.tizen.multi-assistant-service.xml @@ -1,5 +1,5 @@ - + Won Nam Jang Sooyeon Kim diff --git a/packaging/org.tizen.multi-assistant-service.spec b/packaging/org.tizen.multi-assistant-service.spec index 31eed78..f5ffa24 100644 --- a/packaging/org.tizen.multi-assistant-service.spec +++ b/packaging/org.tizen.multi-assistant-service.spec @@ -1,6 +1,6 @@ Name: org.tizen.multi-assistant-service Summary: Multi assistant service -Version: 0.2.33 +Version: 0.2.34 Release: 1 Group: Graphics & UI Framework/Voice Framework License: Flora-1.1 -- 2.7.4 From 63c1b48f41d2db9606e5a5c1d7e72c73156ef2db Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Thu, 28 May 2020 15:34:13 +0900 Subject: [PATCH 13/16] Bump version to 0.3.0 Change-Id: I0885fbe773417eac7446e218285f0e2dd040710c --- org.tizen.multi-assistant-service.xml | 2 +- packaging/org.tizen.multi-assistant-service.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/org.tizen.multi-assistant-service.xml b/org.tizen.multi-assistant-service.xml index 7c451d8..6a9d5d7 100644 --- a/org.tizen.multi-assistant-service.xml +++ b/org.tizen.multi-assistant-service.xml @@ -1,5 +1,5 @@ - + Won Nam Jang Sooyeon Kim diff --git a/packaging/org.tizen.multi-assistant-service.spec b/packaging/org.tizen.multi-assistant-service.spec index 68165fa..16df664 100644 --- a/packaging/org.tizen.multi-assistant-service.spec +++ b/packaging/org.tizen.multi-assistant-service.spec @@ -1,6 +1,6 @@ Name: org.tizen.multi-assistant-service Summary: Multi assistant service -Version: 0.2.32 +Version: 0.3.0 Release: 1 Group: Graphics & UI Framework/Voice Framework License: Flora-1.1 -- 2.7.4 From 5dcb093491a6775b36de86a4ece7f8b42fdd7373 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Thu, 4 Jun 2020 17:38:22 +0900 Subject: [PATCH 14/16] Prevent sending dbus messages to panel if panel is not enabled Change-Id: I85518b160461f93829cc0fe77a1a5af680659b02 --- src/service_main.cpp | 35 +++++++++++++++++++++++++---------- src/service_plugin.cpp | 2 +- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/src/service_main.cpp b/src/service_main.cpp index 656a91c..83f5f69 100644 --- a/src/service_main.cpp +++ b/src/service_main.cpp @@ -138,9 +138,13 @@ int CServiceMain::client_send_voice_key_status_change(pid_t pid, ma_voice_key_st int CServiceMain::client_send_asr_result(pid_t pid, int event, const char* asr_result) { MAS_LOGD("[Enter] pid(%d), event(%d), asr_result(%s)", pid, event, asr_result); - int ret = mServiceIpc.masc_ui_dbus_send_asr_result(pid, event, asr_result); - if (0 != ret){ - MAS_LOGE("[ERROR] Fail to send asr result, ret(%d)", ret); + bool ui_panel_enabled = mServicePlugin.is_ui_panel_enabled(); + int ret = 0; + if (ui_panel_enabled) { + ret = mServiceIpc.masc_ui_dbus_send_asr_result(pid, event, asr_result); + if (0 != ret){ + MAS_LOGE("[ERROR] Fail to send asr result, ret(%d)", ret); + } } // if final event is , launch assistant app which is invoked with wakeup word. @@ -152,9 +156,13 @@ int CServiceMain::client_send_result(pid_t pid, const char* display_text, const char* utterance_text, const char* result_json) { MAS_LOGD("[Enter] pid(%d), display_text(%s), utterance_text(%s), result_json(%s)", pid, display_text, utterance_text, result_json); - int ret = mServiceIpc.masc_ui_dbus_send_result(pid, display_text, utterance_text, result_json); - if (0 != ret){ - MAS_LOGE("[ERROR] Fail to send result, ret(%d)", ret); + bool ui_panel_enabled = mServicePlugin.is_ui_panel_enabled(); + int ret = 0; + if (ui_panel_enabled) { + mServiceIpc.masc_ui_dbus_send_result(pid, display_text, utterance_text, result_json); + if (0 != ret){ + MAS_LOGE("[ERROR] Fail to send result, ret(%d)", ret); + } } std::string pid_appid; @@ -170,9 +178,13 @@ int CServiceMain::client_send_result(pid_t pid, const char* display_text, int CServiceMain::client_send_recognition_result(pid_t pid, int result) { MAS_LOGD("[Enter] pid(%d), result(%d)", pid, result); - int ret = mServiceIpc.masc_ui_dbus_send_recognition_result(pid, result); - if (0 != ret){ - MAS_LOGE("[ERROR] Fail to send recognition result, ret(%d)", ret); + bool ui_panel_enabled = mServicePlugin.is_ui_panel_enabled(); + int ret = 0; + if (ui_panel_enabled) { + mServiceIpc.masc_ui_dbus_send_recognition_result(pid, result); + if (0 != ret){ + MAS_LOGE("[ERROR] Fail to send recognition result, ret(%d)", ret); + } } std::string pid_appid; @@ -416,7 +428,10 @@ int CServiceMain::ui_client_change_assistant(const char* appid) } bool use_custom_ui = get_client_custom_ui_option_by_appid(appid); - mServiceIpc.masc_ui_dbus_enable_common_ui(!use_custom_ui); + bool ui_panel_enabled = mServicePlugin.is_ui_panel_enabled(); + if (ui_panel_enabled) { + mServiceIpc.masc_ui_dbus_enable_common_ui(!use_custom_ui); + } set_current_client_by_appid(appid); pid_t pid = get_client_pid_by_appid(appid); diff --git a/src/service_plugin.cpp b/src/service_plugin.cpp index 6cef985..2af558b 100644 --- a/src/service_plugin.cpp +++ b/src/service_plugin.cpp @@ -45,7 +45,7 @@ typedef struct { bool CServicePlugin::is_ui_panel_enabled() { /* By default we assume the ui panel is always enabled unless explicitly turned off */ - bool ret = true; + bool ret = false; if (mPluginSettings) { ret = mPluginSettings->ui_panel_enabled; } -- 2.7.4 From 2806f3f4473ee536e5609a8561a04adffcdb2b9f Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Thu, 4 Jun 2020 17:39:22 +0900 Subject: [PATCH 15/16] Remove unnecessary white space between function name and parenthesis Change-Id: I5ccf150157572b8dbc1b3c2ea96c81002a69124a --- src/service_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/service_main.cpp b/src/service_main.cpp index 83f5f69..f40a2a8 100644 --- a/src/service_main.cpp +++ b/src/service_main.cpp @@ -1272,7 +1272,7 @@ static void _package_manager_event_cb(const char *type, const char *package, pac user = true; ret = pkgmgrinfo_pkginfo_get_usr_pkginfo(package, uid, &handle); if (ret != PMINFO_R_OK || NULL == handle) { - MAS_LOGW("Failed to call pkgmgrinfo_pkginfo_get_pkginfo & get_usr_pkginfo(\"%s\",~) returned %d, uid : %d", package, ret, getuid ()); + MAS_LOGW("Failed to call pkgmgrinfo_pkginfo_get_pkginfo & get_usr_pkginfo(\"%s\",~) returned %d, uid : %d", package, ret, getuid()); pkginfo_found = false; } } -- 2.7.4 From 33412e4cef85993f661ce340d450f4a1540fbaa7 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Thu, 4 Jun 2020 17:39:44 +0900 Subject: [PATCH 16/16] Bump version to 0.3.2 Change-Id: I2cf047053df57fc2052be9c73d38e4afad4bd793 --- org.tizen.multi-assistant-service.xml | 2 +- packaging/org.tizen.multi-assistant-service.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/org.tizen.multi-assistant-service.xml b/org.tizen.multi-assistant-service.xml index 2e04448..378863b 100644 --- a/org.tizen.multi-assistant-service.xml +++ b/org.tizen.multi-assistant-service.xml @@ -1,5 +1,5 @@ - + Won Nam Jang Sooyeon Kim diff --git a/packaging/org.tizen.multi-assistant-service.spec b/packaging/org.tizen.multi-assistant-service.spec index 7ba06df..8c201ec 100644 --- a/packaging/org.tizen.multi-assistant-service.spec +++ b/packaging/org.tizen.multi-assistant-service.spec @@ -1,6 +1,6 @@ Name: org.tizen.multi-assistant-service Summary: Multi assistant service -Version: 0.3.1 +Version: 0.3.2 Release: 1 Group: Graphics & UI Framework/Voice Framework License: Flora-1.1 -- 2.7.4