From 7fe11c55ddcb53d534b0bd95f82ef5647e831d40 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Wed, 2 Dec 2020 18:11:27 +0900 Subject: [PATCH 01/16] Remove unnecessary log messages from INFO tag Change-Id: I53375ef3e1f4f1bebe19b70bc6a43b3a71235fde --- src/client_manager.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/client_manager.cpp b/src/client_manager.cpp index 18339df..2fd5b61 100644 --- a/src/client_manager.cpp +++ b/src/client_manager.cpp @@ -75,7 +75,7 @@ int CClientManager::destroy_client_by_appid(std::string appid) ma_client_s* CClientManager::find_client_by_appid(std::string appid) { - MAS_LOGI("Looking for client with appid : %s", appid.c_str()); + MAS_LOGD("Looking for client with appid : %s", appid.c_str()); ma_client_s *data = NULL; int count = g_slist_length(mClientList); @@ -86,7 +86,7 @@ ma_client_s* CClientManager::find_client_by_appid(std::string appid) if (NULL != data) { if (0 == appid.compare(data->appid)) { - MAS_LOGI("Found client : %s %d", data->appid.c_str(), data->pid); + MAS_LOGD("Found client : %s %d", data->appid.c_str(), data->pid); return data; } } @@ -141,7 +141,7 @@ pid_t CClientManager::find_client_pid_by_index(unsigned int index) pid_t CClientManager::find_client_pid_by_appid(std::string appid) { - MAS_LOGI("Checking PID of appid : %s", appid.c_str()); + MAS_LOGD("Checking PID of appid : %s", appid.c_str()); pid_t pid = -1; if (nullptr == mApplicationManager) { @@ -151,7 +151,7 @@ pid_t CClientManager::find_client_pid_by_appid(std::string appid) ma_client_s* client = find_client_by_appid(appid); if (client) { - MAS_LOGI("Found client : %s %d", client->appid.c_str(), client->pid); + MAS_LOGD("Found client : %s %d", client->appid.c_str(), client->pid); bool running = mApplicationManager->is_application_running(client->pid); if (false == running) { MAS_LOGE("The PID for %s was %d, but it seems to be terminated", @@ -160,6 +160,9 @@ pid_t CClientManager::find_client_pid_by_appid(std::string appid) pid = client->pid; } } + if (-1 == pid) { + MAS_LOGE("PID lookup failed for : %s", appid.c_str()); + } return pid; } -- 2.7.4 From 45d9a3e1ab5a8273937c3f80704196446cf059b7 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Wed, 2 Dec 2020 19:27:32 +0900 Subject: [PATCH 02/16] Enable heap tracer and disallow free'ing unmanaged chunks Change-Id: If153dcbe74fc218c1c06228e14a10019dbaaf9b3 --- plugins/wakeup-manager/src/heap_tracer.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/plugins/wakeup-manager/src/heap_tracer.cpp b/plugins/wakeup-manager/src/heap_tracer.cpp index acf5bc6..fc24d84 100644 --- a/plugins/wakeup-manager/src/heap_tracer.cpp +++ b/plugins/wakeup-manager/src/heap_tracer.cpp @@ -18,7 +18,8 @@ const bool HEAP_TRACER_LOG_ENABLED = false ; #define DESCRIPTION_LENGTH 255 -//#define USE_HEAP_TRACER +#define USE_HEAP_TRACER +//#define ALLOW_FREE_UNMANAGED //#define RECORD_ALL_HISTORY void* vm_calloc(size_t nmemb, size_t size, const char *fmt, ...) @@ -60,14 +61,24 @@ void vm_free(void *ptr, const char *fmt, ...) va_list argptr; va_start(argptr, fmt); + bool managed = true; char description[DESCRIPTION_LENGTH]; vsnprintf(description, sizeof(description), fmt, argptr); if (false == _tracer.Delete(ptr, description)) { + managed = false; _tracer.Find(ptr); } - va_end(argptr); +#ifdef ALLOW_FREE_UNMANAGED + free(ptr); +#else + if (managed) { + free(ptr); + } #endif + va_end(argptr); +#else free(ptr); +#endif } else { LOGD("Trying to free a null pointer"); } -- 2.7.4 From 070192d25da12e8b67de6e596ca521d8e775fb6e Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Wed, 2 Dec 2020 19:27:57 +0900 Subject: [PATCH 03/16] Bump version to 0.3.12 Change-Id: Ie0a617563a3e7bc93f7a5c807349b129c1c209f9 --- 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 4f4e7aa..d0e72d1 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 beb4a22..27c266d 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.11 +Version: 0.3.12 Release: 1 Group: Graphics & UI Framework/Voice Framework License: Flora-1.1 -- 2.7.4 From be865c6d6b35e58e2f6bc70042e8d141a3cf7238 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Thu, 3 Dec 2020 22:00:57 +0900 Subject: [PATCH 04/16] Add periodic log for audio feeding events Change-Id: I1e1b8d22a4a71b2175ba79f04c40b0991f6a4e70 --- plugins/wakeup-manager/src/wakeup_manager_wrapper.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/plugins/wakeup-manager/src/wakeup_manager_wrapper.cpp b/plugins/wakeup-manager/src/wakeup_manager_wrapper.cpp index 922a403..d88dd34 100644 --- a/plugins/wakeup-manager/src/wakeup_manager_wrapper.cpp +++ b/plugins/wakeup-manager/src/wakeup_manager_wrapper.cpp @@ -743,7 +743,20 @@ int wakeup_manager_set_voice_key_status_changed_callback(wakeup_service_voice_ke int wakeup_manager_feed_audio_data(mas_speech_streaming_event_e event, void* buffer, int len) { if (nullptr == g_wakeup_manager) return -1; + + static unsigned int num = 0; + const std::chrono::seconds interval(5); + static auto last = std::chrono::steady_clock::now(); + auto now = std::chrono::steady_clock::now(); + if (now - last > interval) { + MWR_LOGI("Feeding audio data : num(%d), now(%" PRId64 ")", + num, now.time_since_epoch().count()); + last = now; + } + num++; + g_wakeup_manager->feed_audio_data(event, buffer, len); + return 0; } -- 2.7.4 From d92269fb4c619356fcfc6356a2cbbe77978d6daa Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Fri, 4 Dec 2020 17:13:45 +0900 Subject: [PATCH 05/16] Add more logs that can help analyzing various issues Change-Id: Ic69134d9673f15aa01b7f9ac71cbad37cafbf301 --- plugins/wakeup-manager/src/wakeup_engine_manager.cpp | 12 ++++++++---- src/service_main.cpp | 4 +++- src/service_plugin.cpp | 16 +++++++--------- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/plugins/wakeup-manager/src/wakeup_engine_manager.cpp b/plugins/wakeup-manager/src/wakeup_engine_manager.cpp index 09803a8..56c06ca 100644 --- a/plugins/wakeup-manager/src/wakeup_engine_manager.cpp +++ b/plugins/wakeup-manager/src/wakeup_engine_manager.cpp @@ -892,10 +892,6 @@ void CWakeupEngineManager::add_engine(string name, string path) /* All the necessary information has already been set properly */ mEngineInfo.push_back(info); - MWR_LOGD("Initializing wakeup engine : %s %p", - info.engine_path.c_str(), - info.interface.initialize); - /* Workaround for registering C-style callbacks */ typedef struct { CWakeupEngineManager *manager; @@ -909,10 +905,16 @@ void CWakeupEngineManager::add_engine(string name, string path) user_data.engine_name = info.engine_name; callback_user_data.push_back(user_data); + MWR_LOGI("Initializing wakeup engine : %s %p %p", + info.engine_path.c_str(), + info.interface.initialize, + &callback_user_data.back()); + try { if (info.interface.set_wakeup_event_callback) { info.interface.set_wakeup_event_callback( [](mas_wakeup_event_info info, void* user_data) { + MWR_LOGI("user_data : %p", user_data); CallbackUserData *data = static_cast(user_data); if (nullptr == data) return; if (nullptr == data->manager) return; @@ -924,6 +926,7 @@ void CWakeupEngineManager::add_engine(string name, string path) if (info.interface.set_audio_data_require_status_callback) { info.interface.set_audio_data_require_status_callback( [](bool require, void* user_data) { + MWR_LOGI("user_data : %p", user_data); CallbackUserData *data = static_cast(user_data); if (nullptr == data) return; if (nullptr == data->manager) return; @@ -935,6 +938,7 @@ void CWakeupEngineManager::add_engine(string name, string path) info.interface.set_wakeup_engine_command_callback( [](mas_wakeup_engine_command_target_e target, const char* assistant_name, const char* command, void* user_data) { + MWR_LOGI("user_data : %p", user_data); CallbackUserData* data = static_cast(user_data); if (nullptr == data) return; if (nullptr == data->manager) return; diff --git a/src/service_main.cpp b/src/service_main.cpp index 1adff91..3a617ae 100644 --- a/src/service_main.cpp +++ b/src/service_main.cpp @@ -602,7 +602,7 @@ static void active_state_changed_cb(std::string key, void* user_data) boost::optional activated = manager->get_bool(MULTI_ASSISTANT_SETTINGS_ACTIVATED); if (activated) { - MAS_LOGD("multi-assistant active state : %d\n", *activated); + MAS_LOGI("multi-assistant active state : %d\n", *activated); CServicePlugin *plugin = nullptr; if (g_service_main) { @@ -617,6 +617,8 @@ static void active_state_changed_cb(std::string key, void* user_data) } else { MAS_LOGE("Could not change plugin state : %p %p", g_service_main, plugin); } + } else { + MAS_LOGE("Get value failed for : %s", MULTI_ASSISTANT_SETTINGS_ACTIVATED); } } diff --git a/src/service_plugin.cpp b/src/service_plugin.cpp index 97ad519..6f820c6 100644 --- a/src/service_plugin.cpp +++ b/src/service_plugin.cpp @@ -94,7 +94,7 @@ static void process_wakeup_event_by_appid_timer(void* data) AsyncParam* param = static_cast(data); char* appid = static_cast(param->data); - MAS_LOGD("[ENTER] appid(%s), id(%d), g_last_wakeup_event_id(%d)", + MAS_LOGI("[ENTER] appid(%s), id(%d), g_last_wakeup_event_id(%d)", appid, param->id, g_last_wakeup_event_id); if (!appid) { @@ -134,7 +134,7 @@ static void process_wakeup_event_by_appid_timer(void* data) service_main->process_preprocessing_state_event(PREPROCESSING_STATE_EVENT_ASSISTANT_ACTIVATED); } else { // Appropriate MA Client not available, trying to launch new one - MAS_LOGD("MA Client with appid %s does not exist, launching client", appid); + MAS_LOGI("MA Client with appid %s does not exist, launching client", appid); service_main->launch_client_by_appid(appid, CLIENT_LAUNCH_MODE_ACTIVATION); } } @@ -148,7 +148,7 @@ static void process_wakeup_event_by_word_timer(void* data) if (nullptr == data) return; AsyncParam* param = static_cast(data); - MAS_LOGD("[ENTER] wakeword(%s), id(%d)", (const char*)(param->data), param->id); + MAS_LOGI("[ENTER] wakeword(%s), id(%d)", (const char*)(param->data), param->id); if (!param->data) { delete param; @@ -182,14 +182,13 @@ static void process_wakeup_event_by_word_timer(void* data) } } - MAS_LOGD("END"); + MAS_LOGI("END"); return; } static void __wakeup_event_cb(mas_wakeup_event_info wakeup_info, void* user_data) { - MAS_LOGD("dalton debug : %p", user_data); - MAS_LOGD("[SUCCESS] __wakeup_event_cb is called, wakeup_word(%s)", wakeup_info.wakeup_word); + MAS_LOGI("[SUCCESS] __wakeup_event_cb is called, wakeup_word(%s)", wakeup_info.wakeup_word); int ret = -1; CServicePlugin *plugin = static_cast(user_data); @@ -425,7 +424,7 @@ static void __speech_status_cb(mas_speech_status_e status, void *user_data) static void __error_cb(int error, const char* err_msg, void* user_data) { - MAS_LOGD("[SUCCESS] __error_cb is called, error(%d), err_msg(%s)", error, err_msg); + MAS_LOGE("[SUCCESS] __error_cb is called, error(%d), err_msg(%s)", error, err_msg); CServicePlugin *plugin = static_cast(user_data); if (nullptr == plugin) return; @@ -454,7 +453,7 @@ static void __setting_changed_cb(void *user_data) static void __streaming_section_changed_cb(ma_audio_streaming_data_section_e section, void* user_data) { - MAS_LOGD("[SUCCESS] __streaming_section_changed_cb is called, section(%d)", section); + MAS_LOGI("[SUCCESS] __streaming_section_changed_cb is called, section(%d)", section); CServicePlugin *plugin = static_cast(user_data); if (nullptr == plugin) return; @@ -1347,7 +1346,6 @@ int CServicePlugin::set_wakeup_event_callback(wakeup_service_wakeup_event_cb cal MAS_LOGE("[ERROR] symbol lookup failed : %s", MA_WAKEUP_MANAGER_FUNC_SET_WAKEUP_EVENT_CALLBACK); } else { ret = func(callback, user_data); - MAS_LOGD("dalton debug : %p", user_data); if (0 != ret) { MAS_LOGE("[ERROR] Fail to set wakeup event callback, ret(%d)", ret); } -- 2.7.4 From f47dba8a113b66db870fd8390efbd9e46e51e897 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Tue, 8 Dec 2020 12:10:05 +0900 Subject: [PATCH 06/16] Print error log only when apply_device_for_stream_routing fails Change-Id: I1e4a4f235cc16bdd363a9557449575f3535d4089 --- .../dependency-default/src/dependency_default_audio.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/plugins/wakeup-manager/dependency-default/src/dependency_default_audio.cpp b/plugins/wakeup-manager/dependency-default/src/dependency_default_audio.cpp index ed4ab66..9f59d08 100644 --- a/plugins/wakeup-manager/dependency-default/src/dependency_default_audio.cpp +++ b/plugins/wakeup-manager/dependency-default/src/dependency_default_audio.cpp @@ -154,12 +154,6 @@ void dependency_default_audio_initialize(mas_dependency_plugin_proxy_interface i ret = _apply_device_for_stream_routing(NULL); if (0 != ret) { LOGE("[Recorder ERROR] Fail to apply device for stream routing: %d", ret); - sound_manager_remove_device_connection_changed_cb(g_device_id); - sound_manager_destroy_stream_information(g_stream_info); - g_stream_info = NULL; - audio_in_destroy(g_audio_in); - g_audio_in = NULL; - return; } ret = audio_in_set_state_changed_cb(g_audio_in, _audio_in_state_changed_cb, NULL); -- 2.7.4 From c4c6e5ddc7a865b31b866f2982ab4b04cc18b06b Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Wed, 16 Dec 2020 15:09:06 +0900 Subject: [PATCH 07/16] Fix bug the first item in the list gets omitted when resuming Change-Id: If77c9727f70f370ad776c8bf673dea4f9a8262f4 --- plugins/wakeup-manager/src/wakeup_audio_manager.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/plugins/wakeup-manager/src/wakeup_audio_manager.cpp b/plugins/wakeup-manager/src/wakeup_audio_manager.cpp index c110c01..a33a84c 100644 --- a/plugins/wakeup-manager/src/wakeup_audio_manager.cpp +++ b/plugins/wakeup-manager/src/wakeup_audio_manager.cpp @@ -242,11 +242,12 @@ void CAudioManager::streaming_audio_data_thread_func(long long start_time) auto begin = mAudioData.begin(); lock.unlock(); if (iter == end) { - iter = begin; - } - lead = iter; - if (lead != end) { - advance(lead, 1); + lead = begin; + } else { + lead = iter; + if (lead != end) { + advance(lead, 1); + } } if (lead != end) { MWR_LOGD("[INFO] Resume thread"); -- 2.7.4 From 760be2d3d75f0f42b330ef989db5fea268457907 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Wed, 16 Dec 2020 16:40:09 +0900 Subject: [PATCH 08/16] Bump version to 0.3.13 Change-Id: Icb84f7ffbbef101818f76fa6ab9465f9768deee5 --- 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 d0e72d1..f8cce66 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 27c266d..ae9ec00 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.12 +Version: 0.3.13 Release: 1 Group: Graphics & UI Framework/Voice Framework License: Flora-1.1 -- 2.7.4 From ba0727f2025101be850a77619601ae08c731308a Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Wed, 16 Dec 2020 20:47:40 +0900 Subject: [PATCH 09/16] Bump version to 0.3.13 Change-Id: Ic189cf89b28f9d80e91d18daa3fe45d30060a8a7 --- 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 d0e72d1..f8cce66 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 27c266d..ae9ec00 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.12 +Version: 0.3.13 Release: 1 Group: Graphics & UI Framework/Voice Framework License: Flora-1.1 -- 2.7.4 From d3bc6c3894a60e3a2bd399b118f43fcb2abdbaac Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Tue, 29 Dec 2020 22:02:01 +0900 Subject: [PATCH 10/16] Add NULL check before calling dbus_bus_release_name() Change-Id: I8ffc6bb4b4cf1eed1604a8a26067a733c5601843 --- src/service_ipc_dbus.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/service_ipc_dbus.cpp b/src/service_ipc_dbus.cpp index bb1c3fa..f8027cd 100644 --- a/src/service_ipc_dbus.cpp +++ b/src/service_ipc_dbus.cpp @@ -1246,11 +1246,14 @@ int CServiceIpcDbus::close_connection() mFdHandler = NULL; } - dbus_bus_release_name(mConnectionListener, MA_SERVER_SERVICE_NAME, &err); - - if (dbus_error_is_set(&err)) { - MAS_LOGE("[Dbus ERROR] dbus_bus_release_name() : %s", err.message); - dbus_error_free(&err); + if (NULL != mConnectionListener) { + dbus_bus_release_name(mConnectionListener, MA_SERVER_SERVICE_NAME, &err); + if (dbus_error_is_set(&err)) { + MAS_LOGE("[Dbus ERROR] dbus_bus_release_name() : %s", err.message); + dbus_error_free(&err); + } + } else { + MAS_LOGE("mConnectionListener is NULL!!"); } connection_free(); -- 2.7.4 From 76e50739226d946a8b17ceb2858bfc29bcddd4ad Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Tue, 29 Dec 2020 22:02:36 +0900 Subject: [PATCH 11/16] Bump version to 0.3.14 Change-Id: I9a513c5c9a0349f2883a1f57724e3133098eef4d --- 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 f8cce66..282142a 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 ae9ec00..d3dee79 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.13 +Version: 0.3.14 Release: 1 Group: Graphics & UI Framework/Voice Framework License: Flora-1.1 -- 2.7.4 From 43a2ecd35ac827f3fd6161aff3828730ddbbee7e Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Thu, 24 Dec 2020 19:43:17 +0900 Subject: [PATCH 12/16] Use trusted message port for secure audio transmission Change-Id: I48971865acb4750f52c83bebbb46797d859901f2 --- CMakeLists.txt | 3 + packaging/org.tizen.multi-assistant-service.spec | 10 ++++ signatures/tv/author-signature.xml | 74 ++++++++++++++++++++++++ signatures/tv/signature1.xml | 74 ++++++++++++++++++++++++ src/service_ipc_dbus.cpp | 13 +++++ 5 files changed, 174 insertions(+) create mode 100755 signatures/tv/author-signature.xml create mode 100755 signatures/tv/signature1.xml diff --git a/CMakeLists.txt b/CMakeLists.txt index bc07553..3d2eee2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,6 +51,9 @@ IF(NOT "${TEST_TYPE}" STREQUAL "none") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTEST_TYPE=${TEST_TYPE}") ENDIF() +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_TRUSTED_MESSAGE_PORT=${USE_TRUSTED_MESSAGE_PORT}") +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_TRUSTED_MESSAGE_PORT=${USE_TRUSTED_MESSAGE_PORT}") + # OPTION DEBUG ----------------------------------------------------------------------------------- IF("${_SDEBUG}" MATCHES "debug") MESSAGE("Building in debug mode.") diff --git a/packaging/org.tizen.multi-assistant-service.spec b/packaging/org.tizen.multi-assistant-service.spec index d3dee79..d9aa878 100644 --- a/packaging/org.tizen.multi-assistant-service.spec +++ b/packaging/org.tizen.multi-assistant-service.spec @@ -67,6 +67,11 @@ export LDFLAGS %else -DTEST_TYPE="none" \ %endif +%if "%{?profile}" == "tv" + -DUSE_TRUSTED_MESSAGE_PORT="1" \ +%else + -DUSE_TRUSTED_MESSAGE_PORT="0" \ +%endif make %{?jobs:-j%jobs} @@ -74,6 +79,10 @@ make %{?jobs:-j%jobs} rm -rf %{buildroot} %make_install +%if "%{?profile}" == "tv" +install -m 0644 signatures/tv/author-signature.xml "%{buildroot}"/%{TZ_SYS_RO_APP}/%{name} +install -m 0644 signatures/tv/signature1.xml "%{buildroot}"%{TZ_SYS_RO_APP}/%{name} +%endif %check %if "%{_ctest_enable}" == "true" @@ -99,6 +108,7 @@ exit 0 /usr/share/packages/org.tizen.multi-assistant-service.xml %{TZ_SYS_RO_SHARE}/multiassistant/libma-wakeup-manager.so %{TZ_SYS_RO_SHARE}/multiassistant/libma-dependency-default.so +%{TZ_SYS_RO_APP}/%{name}/* #%{_appdir}/lib/* %{_appdir}/bin/* #%defattr(-,app,app,-) diff --git a/signatures/tv/author-signature.xml b/signatures/tv/author-signature.xml new file mode 100755 index 0000000..eaabe07 --- /dev/null +++ b/signatures/tv/author-signature.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + e2rGZ9lURQWep1IIbrRk2NYMw5EXlejQt2B0bMLUyoc= + + + none + + + +MIIDszCCApugAwIBAgIBAjANBgkqhkiG9w0BAQsFADB/MQswCQYDVQQGEwJLUjEU +MBIGA1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+U+0WPz+dkumosXV03HxzcqqcajP/5OumrikQx7LHbRlvLkIPlPOH8yMMS454XCgs +wnSoOxgeorzBchDJll9z+rTaQro7rmCN7TS/N9l2rIEaa/RVEQPUeEeE4yDeMf61 +aDhPEhnNdylV0kyS3YLkJd2KBPedsSKkCWUCi2F9g2bHrnuggkEQtOoP2kTBFKvq +gNAJEzm5q6EdV0Ya0JFescY5oUmtu8ayTc1cBS6OvadXoN/Po62Ir6BOc1JI0tnU +AUlOmJ+Ku5ZRJCrL80ozpbcvz6JU+Xefs4e/uHpmxHSolvHnzTGm866k6JZhj0ug +deAD + + + + + + + + + + + + + + + + diff --git a/signatures/tv/signature1.xml b/signatures/tv/signature1.xml new file mode 100755 index 0000000..5ce25ec --- /dev/null +++ b/signatures/tv/signature1.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + abSCdQC03ZcPoEN8T0eWSILDIhDi2uNziivgdw1gmmQ= + + + none + + + +MIIDrjCCApagAwIBAgIBAjANBgkqhkiG9w0BAQsFADCBkzELMAkGA1UEBhMCS1Ix +FDASBgNVBAgMC1NvdXRoIEtvcmVhMQ4wDAYDVQQHDAVTdXdvbjEmMCQGA1UECgwd +U2Ftc3VuZyBFbGVjdHJvbmljcyBDby4sIEx0ZC4xCzAJBgNVBAsMAlZEMSkwJwYD +VQQDDCBWRCBEaXN0cmlidXRvciBQbGF0Zm9ybSBDQSBDbGFzczAeFw0xNDEyMzAx +MjA2MzhaFw0xNjEyMjkxMjA2MzhaMIGRMQswCQYDVQQGEwJLUjEUMBIGA1UECAwL +U291dGggS29yZWExDjAMBgNVBAcMBVN1d29uMSYwJAYDVQQKDB1TYW1zdW5nIEVs +ZWN0cm9uaWNzIENvLiwgTHRkLjELMAkGA1UECwwCVkQxJzAlBgNVBAMMHlZEIERp +c3RyaWJ1dG9yIFBsYXRmb3JtIFNpZ25lcjCCASIwDQYJKoZIhvcNAQEBBQADggEP +ADCCAQoCggEBAOirdOSugpYCM5xcgLQKmvKw3Tjqy1E47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EOMAwGA1UEBwwFU3V3b24xJjAkBgNVBAoMHVNhbXN1bmcg +RWxlY3Ryb25pY3MgQ28uLCBMdGQuMQswCQYDVQQLDAJWRDEpMCcGA1UEAwwgVkQg +RGlzdHJpYnV0b3IgUGxhdGZvcm0gQ0EgQ2xhc3MwggEiMA0GCSqGSIb3DQEBAQUA +A4IBDwAwggEKAoIBAQCqxXYIny2AsbWjP0GBDzievxzJC/7WvpRIrGBauh3+GoU5 +b1EuQr0wjqrIwyvU+++mAD4eX+9alLqIMj8WrMcHHZC0IAxZutJWhm0LpTI4JVlF +F+CspYbfpC/V3vv3Xoan8YULqPBjb0KsdhlHId87caTDefmdTvY2M9m6n5DYZIGg +iezcbbfOncGaiBudYypHO9CzM67n0p1+ZPL/3pCVoEcETMc/5wXQswHFY3Ded69w +mMKFLUfSZ3bwPnMIv2r5EpaUGS1CcI/HHJbTBGKxX+DmhTCStJAj8WpukHp2opvI +k+iyibNp1PUiQMbMf7AzRzXFHb9+QzTl75QBWh1dAgMBAAGjEDAOMAwGA1UdEwQF +MAMBAf8wDQYJKoZIhvcNAQELBQADggEBAAwiXbmi+g7f+id4kUhwAEQZCKV2csLi +mRbcNSQ4OId+RS3Rqy0LrOi1mA8CZlPJbGRXhWol8AX9Y/4a1Ics4yJZGs27CFZh +qksrEfiQcmS+LjrmadC1a/07+DMujmVyexYX9++4BlXxbBGnTQWQtQwiB9B7XD0D +Gi2lce/ikQNOMAnCuhVa7+009RCa78EL1CtbieJuBg7mPN9Lo9nlNWoRIlx/xL2e +/dToQE0FGpAVorpDyGiLs5fvv7QDGm2UggC3/VlSHxoAglZ3LUwELQhAYA6BThv3 +CTH9rvmnUijqNNo45m7AgdaxdLE7lyMcNOy3yb6ErleUXCIPXbibFjY= + + + + + + + + + + + + + + + + diff --git a/src/service_ipc_dbus.cpp b/src/service_ipc_dbus.cpp index f8027cd..a816966 100644 --- a/src/service_ipc_dbus.cpp +++ b/src/service_ipc_dbus.cpp @@ -246,7 +246,11 @@ int CServiceIpcDbus::send_streaming_audio_data(pid_t pid, int event, void* data, bundle_add_byte(b, "content", pending_buffer, pending_buffer_size); boost::optional appid = mApplicationManager->get_appid_by_pid(pid); if (appid) { +#if USE_TRUSTED_MESSAGE_PORT + int ret = message_port_send_trusted_message((*appid).c_str(), message_port, b); +#else int ret = message_port_send_message((*appid).c_str(), message_port, b); +#endif if (MESSAGE_PORT_ERROR_NONE != ret) masc_message_port_error(ret); } else { @@ -271,7 +275,11 @@ int CServiceIpcDbus::send_streaming_audio_data(pid_t pid, int event, void* data, bundle_add_byte(b, "content", buffer, total_size); boost::optional appid = mApplicationManager->get_appid_by_pid(pid); if (appid) { +#if USE_TRUSTED_MESSAGE_PORT + int ret = message_port_send_trusted_message((*appid).c_str(), message_port, b); +#else int ret = message_port_send_message((*appid).c_str(), message_port, b); +#endif if (MESSAGE_PORT_ERROR_NONE != ret) masc_message_port_error(ret); } else { @@ -428,8 +436,13 @@ int CServiceIpcDbus::send_streaming_section_changed(pid_t pid, int section) total_size += sizeof(streaming_section_header); bundle_add_byte(b, "content", buffer, total_size); +#if USE_TRUSTED_MESSAGE_PORT + int ret = message_port_send_trusted_message( + mClientManager->find_client_appid_by_pid(pid).c_str(), message_port, b); +#else int ret = message_port_send_message( mClientManager->find_client_appid_by_pid(pid).c_str(), message_port, b); +#endif if (MESSAGE_PORT_ERROR_NONE != ret) masc_message_port_error(ret); -- 2.7.4 From 7ba866212ea1fab9164bc3517cd7bab9c95c2a3c Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Mon, 4 Jan 2021 18:04:48 +0900 Subject: [PATCH 13/16] Bump version to 0.3.15 Change-Id: I28d526a0cd1ea33d301b6d3ae5df7b8f8d7c37e2 --- 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 282142a..b8698d7 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 d9aa878..20084eb 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.14 +Version: 0.3.15 Release: 1 Group: Graphics & UI Framework/Voice Framework License: Flora-1.1 -- 2.7.4 From 8fd7475962cd034e310bbb7d80f3521fe73b2548 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Wed, 6 Jan 2021 19:53:36 +0900 Subject: [PATCH 14/16] Add streaming request related log messages Change-Id: Ie560cc01c3a1276d05aefe0527a035163f54a5a3 --- src/service_main.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/service_main.cpp b/src/service_main.cpp index 3a617ae..944eed2 100644 --- a/src/service_main.cpp +++ b/src/service_main.cpp @@ -223,10 +223,13 @@ int CServiceMain::client_send_recognition_result(pid_t pid, int result) int CServiceMain::client_start_streaming_audio_data(pid_t pid, int type) { - MAS_LOGI("[ENTER"); + MAS_LOGI("[ENTER] %d", type); int ret = -1; - if (!is_current_assistant(pid)) return ret; + if (!is_current_assistant(pid)) { + MAS_LOGE("Start streaming request from inactive assistant : %d", pid); + return ret; + } switch(type) { case MA_AUDIO_STREAMING_DATA_TYPE_CURRENT_UTTERANCE: @@ -247,8 +250,13 @@ int CServiceMain::client_start_streaming_audio_data(pid_t pid, int type) int CServiceMain::client_stop_streaming_audio_data(pid_t pid, int type) { + MAS_LOGI("[ENTER] %d", type); + int ret = -1; - if (!is_current_assistant(pid)) return ret; + if (!is_current_assistant(pid)) { + MAS_LOGE("Start streaming request from inactive assistant : %d", pid); + return ret; + } switch(type) { case MA_AUDIO_STREAMING_DATA_TYPE_CURRENT_UTTERANCE: @@ -637,6 +645,7 @@ int CServiceMain::initialize_service_plugin(void) memset(&mClientInfo, 0x00, sizeof(mClientInfo)); mCurrentClientInfo = -1; + MAS_LOGI("mCurrentClientInfo : %d", mCurrentClientInfo); mCurrentPreprocessingClientInfo = -1; mWakeupClientAppId.clear(); @@ -867,6 +876,7 @@ int CServiceMain::set_current_client_by_wakeup_word(const char *wakeup_word) if (0 < strlen(mClientInfo[loop].wakeup_word[inner_loop])) { if (0 == strncmp(wakeup_word, mClientInfo[loop].wakeup_word[inner_loop], MAX_WAKEUP_WORD_LEN)) { mCurrentClientInfo = loop; + MAS_LOGI("mCurrentClientInfo : %d %s", mCurrentClientInfo, wakeup_word); ret = 0; } } @@ -889,6 +899,7 @@ int CServiceMain::set_current_client_by_wakeup_word(const char *wakeup_word) } if (0 == strncmp(wakeup_word, comparand, MAX_WAKEUP_WORD_LEN)) { mCurrentClientInfo = loop; + MAS_LOGI("mCurrentClientInfo : %d %s", mCurrentClientInfo, wakeup_word); ret = 0; } } @@ -917,6 +928,7 @@ int CServiceMain::set_current_client_by_appid(const char *appid) 0 < strlen(mClientInfo[loop].appid) && 0 < strlen(mClientInfo[loop].wakeup_word[0])) { if (strncmp(appid, mClientInfo[loop].appid, MAX_APPID_LEN) == 0) { + MAS_LOGI("mCurrentClientInfo : %d %s", mCurrentClientInfo, appid); mCurrentClientInfo = loop; ret = 0; } -- 2.7.4 From 51e363aeb16ef7f17daca193cee66350792f16f3 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Wed, 6 Jan 2021 19:54:00 +0900 Subject: [PATCH 15/16] Bump version to 0.3.16 Change-Id: Ic800c4d903a227b1221bc31f2e203cd641c3ec47 --- 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 b8698d7..9632685 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 20084eb..dd82f49 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.15 +Version: 0.3.16 Release: 1 Group: Graphics & UI Framework/Voice Framework License: Flora-1.1 -- 2.7.4 From b0f8a2cc1a1b6c2bf825d91593c4fd73875d373a Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Thu, 18 Feb 2021 11:25:21 +0900 Subject: [PATCH 16/16] Add display privilege Change-Id: I3704b99abb51bab2c658316785a74e42439ae5d8 --- org.tizen.multi-assistant-service.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/org.tizen.multi-assistant-service.xml b/org.tizen.multi-assistant-service.xml index 9632685..2dac196 100644 --- a/org.tizen.multi-assistant-service.xml +++ b/org.tizen.multi-assistant-service.xml @@ -33,5 +33,6 @@ http://tizen.org/privilege/volume.set http://tizen.org/privilege/bluetooth http://tizen.org/privilege/bluetooth.admin + http://tizen.org/privilege/display -- 2.7.4