From 4c8d1a6431b61a35627de9e471d3b0bc400eac09 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Fri, 5 Jun 2020 11:26:54 +0900 Subject: [PATCH 01/16] Add missing ret value assignment Change-Id: I2adf76992cabce3cb987af655d2dd3cdf03561be --- src/service_main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/service_main.cpp b/src/service_main.cpp index f40a2a8..7830c3f 100644 --- a/src/service_main.cpp +++ b/src/service_main.cpp @@ -159,7 +159,7 @@ int CServiceMain::client_send_result(pid_t pid, const char* display_text, 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); + 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); } @@ -181,7 +181,7 @@ int CServiceMain::client_send_recognition_result(pid_t pid, int result) 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); + ret = mServiceIpc.masc_ui_dbus_send_recognition_result(pid, result); if (0 != ret){ MAS_LOGE("[ERROR] Fail to send recognition result, ret(%d)", ret); } -- 2.7.4 From b60b5c2461cd93f4ef2244b652ec53902eed27ed Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Mon, 15 Jun 2020 10:38:50 +0900 Subject: [PATCH 02/16] Add utc for preference-manager-vconf Change-Id: Idac4acc21d911a0d08f1322eefb2ecadfd3f8b13 --- tests/utc/CMakeLists.txt | 1 + tests/utc/preference-manager-vconf/CMakeLists.txt | 59 ++++++++ .../test_preference_manager_vconf.cpp | 153 +++++++++++++++++++++ tests/utc/preference-manager-vconf/vconf_mock.cpp | 24 ++++ tests/utc/preference-manager-vconf/vconf_mock.h | 47 +++++++ 5 files changed, 284 insertions(+) create mode 100644 tests/utc/preference-manager-vconf/CMakeLists.txt create mode 100644 tests/utc/preference-manager-vconf/test_preference_manager_vconf.cpp create mode 100644 tests/utc/preference-manager-vconf/vconf_mock.cpp create mode 100644 tests/utc/preference-manager-vconf/vconf_mock.h diff --git a/tests/utc/CMakeLists.txt b/tests/utc/CMakeLists.txt index 332b649..09b035f 100644 --- a/tests/utc/CMakeLists.txt +++ b/tests/utc/CMakeLists.txt @@ -4,3 +4,4 @@ ADD_SUBDIRECTORY(config) ADD_SUBDIRECTORY(client-manager) ADD_SUBDIRECTORY(audio-manager) ADD_SUBDIRECTORY(service-main) +ADD_SUBDIRECTORY(preference-manager-vconf) diff --git a/tests/utc/preference-manager-vconf/CMakeLists.txt b/tests/utc/preference-manager-vconf/CMakeLists.txt new file mode 100644 index 0000000..96c7491 --- /dev/null +++ b/tests/utc/preference-manager-vconf/CMakeLists.txt @@ -0,0 +1,59 @@ +LINK_DIRECTORIES(${CMAKE_BINARY_DIR}) +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}) + +SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden -Wall -Werror") +SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -Wno-unused-function -Wno-sign-compare") +SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -Wl,-zdefs" ) +SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fPIE") +SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -Werror") +SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -std=c++11") +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS}") + +ADD_DEFINITIONS("-DFULLVER=\"${FULLVER}\"") + +SET(TEST_SOURCES + test_preference_manager_vconf.cpp + vconf_mock.cpp + ${CMAKE_SOURCE_DIR}/src/preference_manager_vconf.cpp +) + +# Find Packages +INCLUDE(FindPkgConfig) +pkg_check_modules(pkgs REQUIRED + capi-appfw-application + capi-appfw-preference + multi-assistant + dlog + libxml-2.0 +) + +FOREACH(flag ${pkgs_CFLAGS}) + SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") +ENDFOREACH(flag) + +FIND_PACKAGE(GTest REQUIRED) +INCLUDE_DIRECTORIES(${GTEST_INCLUDE_DIRS}) +LINK_DIRECTORIES(${GTEST_LIBRARY_DIRS}) + +SET(TEST_PREFERENCE_MANAGER_VCONF test-preference-manager-vconf) +ADD_EXECUTABLE(${TEST_PREFERENCE_MANAGER_VCONF} + ${TEST_SOURCES} + ) + +TARGET_LINK_LIBRARIES(${TEST_PREFERENCE_MANAGER_VCONF} -ldl ${GTEST_LIBRARIES} pthread + ${EXTRA_LDFLAGS} ${pkgs_LDFLAGS}) + +SET_TARGET_PROPERTIES(${TEST_PREFERENCE_MANAGER_VCONF} PROPERTIES + COMPILE_FLAGS "-fPIE" + #Never add any space for LINKFLAGS + LINK_FLAGS "-Wl,\ +--wrap=vconf_get_int,\ +--wrap=vconf_get_bool,\ +--wrap=vconf_get_str,\ +--wrap=vconf_notify_key_changed,\ +--wrap=vconf_ignore_key_changed,\ +--wrap=vconf_keynode_get_name") + +INSTALL(TARGETS ${TEST_PREFERENCE_MANAGER_VCONF} DESTINATION bin) + +ADD_TEST(NAME ${TEST_PREFERENCE_MANAGER_VCONF} COMMAND ${TEST_PREFERENCE_MANAGER_VCONF}) diff --git a/tests/utc/preference-manager-vconf/test_preference_manager_vconf.cpp b/tests/utc/preference-manager-vconf/test_preference_manager_vconf.cpp new file mode 100644 index 0000000..5ffe0c2 --- /dev/null +++ b/tests/utc/preference-manager-vconf/test_preference_manager_vconf.cpp @@ -0,0 +1,153 @@ +/* + * Copyright 2020 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.1 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://floralicense.org/license/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include "preference_manager_vconf.h" + +#include + +class DefaultFixture : public testing::Test +{ +public: + DefaultFixture() { + } + virtual ~DefaultFixture() { + } + void SetUp() override { + } + void TearDown() override { + } + + static void dummy_callback(std::string key, void* user_data) { + return; + } + CPreferenceManagerVconf preference_manager; +}; + +TEST_F(DefaultFixture, CanRegisterOneCallback) { + std::string arbitrary_key{"ArbitraryKey"}; + + bool ret = preference_manager.register_changed_callback(arbitrary_key, dummy_callback, nullptr); + + ASSERT_EQ(ret, true); +} + +TEST_F(DefaultFixture, CanRegisterTwoCallbacksForOneKey) { + std::string arbitrary_key{"ArbitraryKey"}; + preference_manager.register_changed_callback(arbitrary_key, dummy_callback, nullptr); + + bool ret = preference_manager.register_changed_callback(arbitrary_key, dummy_callback, nullptr); + + ASSERT_EQ(ret, true); +} + +TEST_F(DefaultFixture, CanRegisterTwoCallbacksForTwoDifferentKeys) { + std::string arbitrary_key_1{"ArbitraryKey1"}; + std::string arbitrary_key_2{"ArbitraryKey2"}; + preference_manager.register_changed_callback(arbitrary_key_1, dummy_callback, nullptr); + + bool ret = preference_manager.register_changed_callback(arbitrary_key_2, dummy_callback, nullptr); + + ASSERT_EQ(ret, true); +} + +TEST_F(DefaultFixture, CanUnregisterOneCallback) { + std::string arbitrary_key{"ArbitraryKey"}; + preference_manager.register_changed_callback(arbitrary_key, dummy_callback, nullptr); + + bool ret = preference_manager.unregister_changed_callback(arbitrary_key, dummy_callback); + + ASSERT_EQ(ret, true); +} + +TEST_F(DefaultFixture, CanUnregisterTwoCallbacksForOneKey) { + std::string arbitrary_key{"ArbitraryKey"}; + preference_manager.register_changed_callback(arbitrary_key, dummy_callback, nullptr); + preference_manager.register_changed_callback(arbitrary_key, dummy_callback, nullptr); + preference_manager.unregister_changed_callback(arbitrary_key, dummy_callback); + + bool ret = preference_manager.unregister_changed_callback(arbitrary_key, dummy_callback); + + ASSERT_EQ(ret, true); +} + +TEST_F(DefaultFixture, CanUnregisterTwoCallbacksForTwoDifferentKeys) { + std::string arbitrary_key_1{"ArbitraryKey1"}; + std::string arbitrary_key_2{"ArbitraryKey2"}; + preference_manager.register_changed_callback(arbitrary_key_1, dummy_callback, nullptr); + preference_manager.register_changed_callback(arbitrary_key_2, dummy_callback, nullptr); + preference_manager.unregister_changed_callback(arbitrary_key_1, dummy_callback); + + bool ret = preference_manager.unregister_changed_callback(arbitrary_key_2, dummy_callback); + + ASSERT_EQ(ret, true); +} + +TEST_F(DefaultFixture, CanUnregisterThreeCallbacksForThreeDifferentKeysForward) { + std::string arbitrary_key_1{"ArbitraryKey1"}; + std::string arbitrary_key_2{"ArbitraryKey2"}; + std::string arbitrary_key_3{"ArbitraryKey3"}; + preference_manager.register_changed_callback(arbitrary_key_1, dummy_callback, nullptr); + preference_manager.register_changed_callback(arbitrary_key_2, dummy_callback, nullptr); + preference_manager.register_changed_callback(arbitrary_key_3, dummy_callback, nullptr); + preference_manager.unregister_changed_callback(arbitrary_key_1, dummy_callback); + preference_manager.unregister_changed_callback(arbitrary_key_2, dummy_callback); + + bool ret = preference_manager.unregister_changed_callback(arbitrary_key_3, dummy_callback); + + ASSERT_EQ(ret, true); +} + +TEST_F(DefaultFixture, CanUnregisterThreeCallbacksForThreeDifferentKeysBackward) { + std::string arbitrary_key_1{"ArbitraryKey1"}; + std::string arbitrary_key_2{"ArbitraryKey2"}; + std::string arbitrary_key_3{"ArbitraryKey3"}; + preference_manager.register_changed_callback(arbitrary_key_1, dummy_callback, nullptr); + preference_manager.register_changed_callback(arbitrary_key_2, dummy_callback, nullptr); + preference_manager.register_changed_callback(arbitrary_key_3, dummy_callback, nullptr); + preference_manager.unregister_changed_callback(arbitrary_key_3, dummy_callback); + preference_manager.unregister_changed_callback(arbitrary_key_2, dummy_callback); + + bool ret = preference_manager.unregister_changed_callback(arbitrary_key_1, dummy_callback); + + ASSERT_EQ(ret, true); +} + +TEST_F(DefaultFixture, UnregisterFailsOnKeyNotExists) { + std::string arbitrary_key{"ArbitraryKey"}; + + bool ret = preference_manager.unregister_changed_callback(arbitrary_key, dummy_callback); + + ASSERT_EQ(ret, false); +} + +TEST_F(DefaultFixture, UnregisterFailurePreservesExistingEntry) { + std::string arbitrary_key_1{"ArbitraryKey1"}; + std::string arbitrary_key_2{"ArbitraryKey2"}; + preference_manager.register_changed_callback(arbitrary_key_1, dummy_callback, nullptr); + preference_manager.unregister_changed_callback(arbitrary_key_2, dummy_callback); + + bool ret = preference_manager.unregister_changed_callback(arbitrary_key_1, dummy_callback); + + ASSERT_EQ(ret, true); +} + +int main(int argc, char** argv) { + testing::InitGoogleTest(&argc, argv); + int ret = RUN_ALL_TESTS(); + return ret; +} diff --git a/tests/utc/preference-manager-vconf/vconf_mock.cpp b/tests/utc/preference-manager-vconf/vconf_mock.cpp new file mode 100644 index 0000000..edaf16e --- /dev/null +++ b/tests/utc/preference-manager-vconf/vconf_mock.cpp @@ -0,0 +1,24 @@ +/* + * Copyright 2020 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.1 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://floralicense.org/license/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "vconf_mock.h" + +int __wrap_vconf_get_int(const char *in_key, int *intval) { return 0; } +int __wrap_vconf_get_bool(const char *in_key, int *boolval) { return 0; } +char *__wrap_vconf_get_str(const char *in_key) { return nullptr; } +int __wrap_vconf_notify_key_changed(const char *in_key, vconf_callback_fn cb, void *user_data) { return 0; } +int __wrap_vconf_ignore_key_changed(const char *in_key, vconf_callback_fn cb) { return 0; } +char *__wrap_vconf_keynode_get_name(keynode_t *keynode) { return nullptr; } diff --git a/tests/utc/preference-manager-vconf/vconf_mock.h b/tests/utc/preference-manager-vconf/vconf_mock.h new file mode 100644 index 0000000..23d3750 --- /dev/null +++ b/tests/utc/preference-manager-vconf/vconf_mock.h @@ -0,0 +1,47 @@ +/* + * Copyright 2020 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.1 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://floralicense.org/license/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef VCONF_MOCK_H +#define VCONF_MOCK_H + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct _keynode_t { + char *keyname; /**< Keyname for keynode */ + int type; /**< Keynode type */ + union { + int i; /**< Integer type */ + int b; /**< Bool type */ + double d; /**< Double type */ + char *s; /**< String type */ + } value; /**< Value for keynode */ +} keynode_t; +typedef void (*vconf_callback_fn) (keynode_t *node, void *user_data); + +int __wrap_vconf_get_int(const char *in_key, int *intval); +int __wrap_vconf_get_bool(const char *in_key, int *boolval); +char *__wrap_vconf_get_str(const char *in_key); +int __wrap_vconf_notify_key_changed(const char *in_key, vconf_callback_fn cb, void *user_data); +int __wrap_vconf_ignore_key_changed(const char *in_key, vconf_callback_fn cb); +char *__wrap_vconf_keynode_get_name(keynode_t *keynode); + +#ifdef __cplusplus +} +#endif + +#endif -- 2.7.4 From e382a2d87650c192c378779a326144ebf4a28dc1 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Mon, 15 Jun 2020 11:49:08 +0900 Subject: [PATCH 03/16] Fix utc failure : test-preference-manager-vconf 1. Make unregister_changed_callback to return true only when a certain item was removed from list. 2. Fix crash caused by removing an element inside a range-based for loop. (Now using remove_if instead) Change-Id: I9c676b52c2e63c4f69db35169a4bf967e1d1bf64 --- src/preference_manager_vconf.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/preference_manager_vconf.cpp b/src/preference_manager_vconf.cpp index 985ae38..551d5da 100644 --- a/src/preference_manager_vconf.cpp +++ b/src/preference_manager_vconf.cpp @@ -127,22 +127,26 @@ bool CPreferenceManagerVconf::register_changed_callback( bool CPreferenceManagerVconf::unregister_changed_callback(const std::string& key, preference_changed_cb callback) { + bool removed = false; std::map>::iterator map_iter = mCallbackEntries.find(key); if (map_iter != mCallbackEntries.end()) { - bool found = false; - for (const auto& entry : map_iter->second) { - if (callback == std::get<0>(entry)) { - if (!found) { - map_iter->second.remove(entry); - found = true; + map_iter->second.remove_if( + [&](const CallbackEntry& entry) { + bool found = false; + if (callback == std::get<0>(entry)) { + /* Unregister only one entry at a time */ + if (!removed) { + found = true; + } } - } - } + if (found) removed = true; + return found; + }); if (map_iter->second.empty()) { vconf_ignore_key_changed(key.c_str(), vconf_key_changed); } } - return true; + return removed; } -- 2.7.4 From efb490080309c118c4d48eab95e8fb80b5ac6f3e Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Mon, 15 Jun 2020 11:53:18 +0900 Subject: [PATCH 04/16] Bump version to 0.3.3 Change-Id: Idf3fcc0402c1f5979071c8859c8c842fc2b450f6 --- 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 378863b..2a18a99 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 8c201ec..10c9ac5 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.2 +Version: 0.3.3 Release: 1 Group: Graphics & UI Framework/Voice Framework License: Flora-1.1 -- 2.7.4 From f9124a7b3ddf502a0cdfd8f132ff3bf4109cdf22 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Wed, 8 Jul 2020 21:27:34 +0900 Subject: [PATCH 05/16] Fix streaming START/FINISH event pair mismatch Change-Id: I03680aa7848579ac5fd1235f264d5c74d7bc3876 --- plugins/wakeup-manager/inc/wakeup_manager.h | 6 ++ plugins/wakeup-manager/src/wakeup_manager.cpp | 101 ++++++++++++--------- .../wakeup-manager/src/wakeup_policy_default.cpp | 2 + 3 files changed, 66 insertions(+), 43 deletions(-) diff --git a/plugins/wakeup-manager/inc/wakeup_manager.h b/plugins/wakeup-manager/inc/wakeup_manager.h index de7cb11..437dc06 100644 --- a/plugins/wakeup-manager/inc/wakeup_manager.h +++ b/plugins/wakeup-manager/inc/wakeup_manager.h @@ -136,6 +136,12 @@ public: void feed_audio_data(mas_speech_streaming_event_e event, void* buffer, int len); void set_dependency_module_command(string engine_name, string command); + + void start_streaming_duration_timer(); + void stop_streaming_duration_timer(); + + void set_streaming_duration_timer(Ecore_Timer* timer); + Ecore_Timer* get_streaming_duration_timer(); private: bool change_voice_key_status(ma_voice_key_status_e status); diff --git a/plugins/wakeup-manager/src/wakeup_manager.cpp b/plugins/wakeup-manager/src/wakeup_manager.cpp index b0ddfd1..1df79ea 100644 --- a/plugins/wakeup-manager/src/wakeup_manager.cpp +++ b/plugins/wakeup-manager/src/wakeup_manager.cpp @@ -137,10 +137,7 @@ bool CWakeupManager::deinitialize() { MWR_LOGI("[ENTER]"); - if (mStreamingDurationTimer) { - ecore_timer_del(mStreamingDurationTimer); - mStreamingDurationTimer = nullptr; - } + stop_streaming_duration_timer(); dependency_resolver_deinitialize(); @@ -562,6 +559,7 @@ bool CWakeupManager::process_plugin_event(mas_plugin_event_e event, void* data, } } if (stop_recording) { + stop_streaming_duration_timer(); mAudioManager.finalize_audio_data(); if (STREAMING_MODE::UTTERANCE == mStreamingMode) { @@ -603,6 +601,8 @@ static Eina_Bool streaming_duration_expired(void *data) CWakeupManager *wakeup_manager = static_cast(data); if (nullptr == wakeup_manager) return ECORE_CALLBACK_CANCEL; + wakeup_manager->set_streaming_duration_timer(nullptr); + CAudioManager *audio_manager = wakeup_manager->get_audio_manager(); CWakeupEngineManager *engine_manager = wakeup_manager->get_engine_manager(); @@ -658,17 +658,10 @@ bool CWakeupManager::start_streaming_utterance_data() mAudioManager.start_streaming_current_utterance_data(mLastWakeupEventInfo.wakeup_end_time); } - ecore_thread_main_loop_begin(); - if (mStreamingDurationTimer) { - ecore_timer_del(mStreamingDurationTimer); - mStreamingDurationTimer = nullptr; - } + stop_streaming_duration_timer(); if (streaming_by_manager) { - mStreamingDurationTimer = ecore_timer_add( - mWakeupSettings.get_streaming_duration_max(), - streaming_duration_expired, this); + start_streaming_duration_timer(); } - ecore_thread_main_loop_end(); MWR_LOGD("[END]"); return true; @@ -683,10 +676,7 @@ bool CWakeupManager::stop_streaming_utterance_data() mWakeupEngineManager.stop_streaming_current_utterance_data(); if (mStreamingDurationTimer) { - ecore_thread_main_loop_begin(); - ecore_timer_del(mStreamingDurationTimer); - mStreamingDurationTimer = nullptr; - ecore_thread_main_loop_end(); + stop_streaming_duration_timer(); } if (WAKEUP_MANAGER_STATE_UTTERANCE == mWakeupManagerState) { change_manager_state(WAKEUP_MANAGER_STATE_PROCESSING); @@ -717,15 +707,8 @@ bool CWakeupManager::start_streaming_follow_up_data() mAudioManager.start_streaming_follow_up_data(); - ecore_thread_main_loop_begin(); - if (mStreamingDurationTimer) { - ecore_timer_del(mStreamingDurationTimer); - mStreamingDurationTimer = nullptr; - } - mStreamingDurationTimer = ecore_timer_add( - mWakeupSettings.get_streaming_duration_max(), - streaming_duration_expired, this); - ecore_thread_main_loop_end(); + stop_streaming_duration_timer(); + start_streaming_duration_timer(); MWR_LOGD("[END]"); return true; @@ -740,10 +723,7 @@ bool CWakeupManager::stop_streaming_follow_up_data() mWakeupEngineManager.stop_streaming_current_utterance_data(); if (mStreamingDurationTimer) { - ecore_thread_main_loop_begin(); - ecore_timer_del(mStreamingDurationTimer); - mStreamingDurationTimer = nullptr; - ecore_thread_main_loop_end(); + stop_streaming_duration_timer(); } if (WAKEUP_MANAGER_STATE_UTTERANCE == mWakeupManagerState) { @@ -771,15 +751,8 @@ bool CWakeupManager::start_streaming_previous_utterance_data() mStreamingMode = STREAMING_MODE::PREVIOUS_UTTERANCE; mAudioManager.start_streaming_previous_utterance_data(); - ecore_thread_main_loop_begin(); - if (mStreamingDurationTimer) { - ecore_timer_del(mStreamingDurationTimer); - mStreamingDurationTimer = nullptr; - } - mStreamingDurationTimer = ecore_timer_add( - mWakeupSettings.get_streaming_duration_max(), - streaming_duration_expired, this); - ecore_thread_main_loop_end(); + stop_streaming_duration_timer(); + start_streaming_duration_timer(); MWR_LOGD("[END]"); return true; @@ -794,10 +767,7 @@ bool CWakeupManager::stop_streaming_previous_utterance_data() mWakeupEngineManager.stop_streaming_current_utterance_data(); if (mStreamingDurationTimer) { - ecore_thread_main_loop_begin(); - ecore_timer_del(mStreamingDurationTimer); - mStreamingDurationTimer = nullptr; - ecore_thread_main_loop_end(); + stop_streaming_duration_timer(); } if (WAKEUP_MANAGER_STATE_UTTERANCE == mWakeupManagerState) { @@ -906,6 +876,49 @@ void CWakeupManager::set_dependency_module_command(string engine_name, string co mWakeupEngineManager.engine_set_dependency_module_command(engine_name, command); } +void CWakeupManager::start_streaming_duration_timer() +{ + ecore_main_loop_thread_safe_call_async([](void* data) { + CWakeupManager* manager = static_cast(data); + if (!manager) return; + + CWakeupSettings *settings = manager->get_wakeup_settings(); + if (settings) { + Ecore_Timer* timer = ecore_timer_add( + settings->get_streaming_duration_max(), + streaming_duration_expired, manager); + manager->set_streaming_duration_timer(timer); + MWR_LOGI("DURATION_TIMER STARTED : %p", timer); + } + }, this); +} + +void CWakeupManager::stop_streaming_duration_timer() +{ + MWR_LOGI("DURATION_TIMER STOP"); + if (mStreamingDurationTimer) { + ecore_main_loop_thread_safe_call_async([](void* data) { + CWakeupManager* manager = static_cast(data); + if (!manager) return; + + Ecore_Timer* timer = manager->get_streaming_duration_timer(); + void* ret = ecore_timer_del(timer); + MWR_LOGI("DURATION_TIMER EXISTS : %p %p", timer, ret); + manager->set_streaming_duration_timer(nullptr); + }, this); + } +} + +void CWakeupManager::set_streaming_duration_timer(Ecore_Timer* timer) +{ + mStreamingDurationTimer = timer; +} + +Ecore_Timer* CWakeupManager::get_streaming_duration_timer() +{ + return mStreamingDurationTimer; +} + bool CWakeupManager::CEngineEventObserver::on_wakeup_event(string engine_name, mas_wakeup_event_info wakeup_info) { MWR_LOGD("[ENTER]"); @@ -977,6 +990,7 @@ bool CWakeupManager::CEngineEventObserver::on_streaming_audio_data( } if (MAS_SPEECH_STREAMING_EVENT_FINISH == event) { mWakeupManager->set_streaming_mode(STREAMING_MODE::NONE); + mWakeupManager->stop_streaming_duration_timer(); } return true; @@ -1066,6 +1080,7 @@ bool CWakeupManager::CAudioEventObserver::on_streaming_audio_data( } if (MAS_SPEECH_STREAMING_EVENT_FINISH == event) { mWakeupManager->set_streaming_mode(STREAMING_MODE::NONE); + mWakeupManager->stop_streaming_duration_timer(); } return true; diff --git a/plugins/wakeup-manager/src/wakeup_policy_default.cpp b/plugins/wakeup-manager/src/wakeup_policy_default.cpp index 7a471fd..e07374c 100644 --- a/plugins/wakeup-manager/src/wakeup_policy_default.cpp +++ b/plugins/wakeup-manager/src/wakeup_policy_default.cpp @@ -59,8 +59,10 @@ void CWakeupPolicyDefault::wakeup_candidate(mas_wakeup_event_info wakeup_info) { mWakeupInfos.push_back(wakeup_info); if (nullptr == mTimer) { + LOGD("Begin Ecore Thread Main Loop"); ecore_thread_main_loop_begin(); mTimer = ecore_timer_add(mDelaySeconds, timer_func, this); + LOGD("End Ecore Thread Main Loop"); ecore_thread_main_loop_end(); } } -- 2.7.4 From c6d3c1c29ba478e9ebe686ccafb2cdf83553b38d Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Thu, 16 Jul 2020 20:12:54 +0900 Subject: [PATCH 06/16] Ignore outdated wakeup timer events Change-Id: I0493c55d587c8d244a2db3f204592e259512172f --- src/multi_assistant_service_plugin.c | 86 ++++++++++++++++++++++++++---------- 1 file changed, 62 insertions(+), 24 deletions(-) diff --git a/src/multi_assistant_service_plugin.c b/src/multi_assistant_service_plugin.c index 6dedaf4..f34d095 100644 --- a/src/multi_assistant_service_plugin.c +++ b/src/multi_assistant_service_plugin.c @@ -93,48 +93,78 @@ Eina_Bool __send_result(void *data) } #endif /* -TEST_CODE */ -Eina_Bool process_wakeup_event_by_appid_timer(char* appid) +static int g_last_wakeup_event_id = 0; +typedef struct { + int id; + char* data; +} wakeup_event; + +void process_wakeup_event_by_appid_timer(wakeup_event* event) { - MAS_LOGD("[ENTER] appid(%s)", appid); + if (!event) return; + MAS_LOGD("[ENTER] appid(%s), id(%d), g_last_wakeup_event_id(%d)", + event->data, event->id, g_last_wakeup_event_id); + + if (!event->data) { + free(event); + return; + } + + if (event->id < g_last_wakeup_event_id) { + free(event->data); + free(event); + return; + } int pid = -1; - if (!appid) return ECORE_CALLBACK_CANCEL; - bool use_custom_ui = mas_get_client_custom_ui_option_by_appid(appid); + bool use_custom_ui = mas_get_client_custom_ui_option_by_appid(event->data); bool ui_panel_enabled = is_ui_panel_enabled(); if (ui_panel_enabled) masc_ui_dbus_enable_common_ui(!use_custom_ui); - mas_set_current_client_by_appid(appid); - if (ui_panel_enabled) masc_ui_dbus_change_assistant(appid); - if ((pid = mas_get_client_pid_by_appid(appid)) != -1) { + mas_set_current_client_by_appid(event->data); + if (ui_panel_enabled) masc_ui_dbus_change_assistant(event->data); + if ((pid = mas_get_client_pid_by_appid(event->data)) != -1) { mas_client_send_preprocessing_information(pid); mas_client_activate(pid); mas_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_launch_client_by_appid(appid, CLIENT_LAUNCH_MODE_ACTIVATION); + MAS_LOGD("MA Client with appid %s does not exist, launching client", event->data); + mas_launch_client_by_appid(event->data, CLIENT_LAUNCH_MODE_ACTIVATION); } - if (appid) free(appid); + free(event->data); + free(event); MAS_LOGD("END"); - return ECORE_CALLBACK_CANCEL; + return; } -Eina_Bool process_wakeup_event_by_word_timer(char* wakeup_word) +void process_wakeup_event_by_word_timer(wakeup_event* event) { - MAS_LOGD("[ENTER]"); + if (!event) return; + MAS_LOGD("[ENTER] wakeword(%s), id(%d)", event->data, event->id); + + if (!event->data) { + free(event); + return; + } - if (!wakeup_word) return EINA_FALSE; + const char* appid = mas_get_client_appid_by_wakeup_word(event->data); - const char* appid = mas_get_client_appid_by_wakeup_word(wakeup_word); - process_wakeup_event_by_appid_timer(strdup(appid)); + wakeup_event* appid_timer_event = malloc(sizeof(wakeup_event)); + if (appid_timer_event) { + appid_timer_event->id = event->id; + appid_timer_event->data = strdup(appid ? appid : ""); + process_wakeup_event_by_appid_timer(event); + } - if (wakeup_word) free(wakeup_word); + free(event->data); + free(event); MAS_LOGD("END"); - return ECORE_CALLBACK_CANCEL; + return; } static void __wakeup_event_cb(mas_wakeup_event_info wakeup_info, void* user_data) @@ -206,13 +236,21 @@ static void __wakeup_event_cb(mas_wakeup_event_info wakeup_info, void* user_data } #endif /* - TEST_CODE */ if (wakeup_info.wakeup_appid) { - ecore_thread_main_loop_begin(); - ecore_timer_add(0.0f, process_wakeup_event_by_appid_timer, (void*)strdup(wakeup_info.wakeup_appid)); - ecore_thread_main_loop_end(); + wakeup_event* appid_timer_event = malloc(sizeof(wakeup_event)); + if (appid_timer_event) { + appid_timer_event->id = ++g_last_wakeup_event_id; + appid_timer_event->data = + strdup(wakeup_info.wakeup_appid ? wakeup_info.wakeup_appid : ""); + ecore_main_loop_thread_safe_call_async(process_wakeup_event_by_appid_timer, (void*)appid_timer_event); + } } else if (wakeup_info.wakeup_word) { - ecore_thread_main_loop_begin(); - ecore_timer_add(0.0f, process_wakeup_event_by_word_timer, (void*)strdup(wakeup_info.wakeup_word)); - ecore_thread_main_loop_end(); + wakeup_event* word_timer_event = malloc(sizeof(wakeup_event)); + if (word_timer_event) { + word_timer_event->id = ++g_last_wakeup_event_id; + word_timer_event->data = + strdup(wakeup_info.wakeup_word ? wakeup_info.wakeup_word : ""); + ecore_main_loop_thread_safe_call_async(process_wakeup_event_by_word_timer, (void*)word_timer_event); + } } } -- 2.7.4 From 9549b5c5b81aa3be186cac1e7caabd05e34c5504 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Fri, 17 Jul 2020 14:30:26 +0900 Subject: [PATCH 07/16] Use async version of aul_launch_app for avoiding deadlock Change-Id: I484ced8492df92262ee34e19b687ae62d4cba76f --- src/multi_assistant_service.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/multi_assistant_service.c b/src/multi_assistant_service.c index 9ed865e..3fc3b00 100644 --- a/src/multi_assistant_service.c +++ b/src/multi_assistant_service.c @@ -1184,9 +1184,9 @@ int mas_bring_client_to_foreground(const char* appid) return -1; } - int result = aul_launch_app(appid, b); + int result = aul_launch_app_async(appid, b); if (result < AUL_R_OK) { - MAS_LOGE("ERROR : aul_launch_app failed. app_id [%s] bundle[%p] result[%d : %s]", + MAS_LOGE("ERROR : aul_launch_app_async failed. app_id [%s] bundle[%p] result[%d : %s]", appid, b, result, get_error_message(result)); } -- 2.7.4 From ed6f6921882fee2577b25be38ef2a2230c39ecef Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Thu, 16 Jul 2020 20:09:12 +0900 Subject: [PATCH 08/16] Add logs for checking wakeup_engine_command delivery Change-Id: Ib114ff5f46c96850d344eb26c43135f371222b74 --- plugins/wakeup-manager/src/wakeup_engine_manager.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/wakeup-manager/src/wakeup_engine_manager.cpp b/plugins/wakeup-manager/src/wakeup_engine_manager.cpp index d9181dc..40f6833 100644 --- a/plugins/wakeup-manager/src/wakeup_engine_manager.cpp +++ b/plugins/wakeup-manager/src/wakeup_engine_manager.cpp @@ -728,7 +728,8 @@ bool CWakeupEngineManager::on_audio_data_require_status(string engine_name, bool bool CWakeupEngineManager::on_wakeup_engine_command(string engine_name, mas_wakeup_engine_command_target_e target, string assistant_name, string command) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER] : %s %d %s %s", + engine_name.c_str(), target, assistant_name.c_str(), command.c_str()); for (const auto& observer : mObservers) { if (observer) { @@ -745,6 +746,7 @@ bool CWakeupEngineManager::on_wakeup_engine_command(string engine_name, mas_wake for (const auto& assistant : iter->assistant_list) { if (0 == assistant_name.compare(assistant) || MAS_WAKEUP_ENGINE_COMMAND_TARGET_ALL_ASSISTANTS == target) { + MWR_LOGI("Calling on_wakeup_engine_command for %s", assistant.c_str()); if (!observer->on_wakeup_engine_command(target, engine_name, assistant, command)) { LOGE("[Recorder WARNING] One of the observer returned false"); } -- 2.7.4 From 39ee9688098e5e7f79fe5d510373fed1c6446152 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Fri, 17 Jul 2020 11:42:04 +0900 Subject: [PATCH 09/16] Bump version to 0.2.35 Change-Id: Ib8b1ca66b5e49ef6266973cb960092c7839473a3 --- 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 db96b45..c012fe7 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 f5ffa24..5288e81 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.34 +Version: 0.2.35 Release: 1 Group: Graphics & UI Framework/Voice Framework License: Flora-1.1 -- 2.7.4 From eb0c49d73f42ef9d2adbad128bf0744b8807ba17 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Fri, 17 Jul 2020 21:29:55 +0900 Subject: [PATCH 10/16] Replace ecore_thread_main_loop_* functions with alternatives Change-Id: Ied3b35f41bb7c9f8bc74bc24d42e5a92e3b4b551 --- plugins/wakeup-manager/inc/wakeup_policy_default.h | 8 ++++++- .../wakeup-manager/src/wakeup_policy_default.cpp | 28 ++++++++++++++++++---- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/plugins/wakeup-manager/inc/wakeup_policy_default.h b/plugins/wakeup-manager/inc/wakeup_policy_default.h index d4b36b7..914c539 100644 --- a/plugins/wakeup-manager/inc/wakeup_policy_default.h +++ b/plugins/wakeup-manager/inc/wakeup_policy_default.h @@ -40,12 +40,18 @@ public: bool valid() override; void set_assistant_priority(string appid, int priority); - void set_delay(float seconds); void wakeup_candidate(mas_wakeup_event_info wakeup_info) override; void select_candidate(mas_wakeup_event_info wakeup_info) override; void timer_expired(); + + void set_delay(float seconds); + float get_delay(); + + void set_timer(Ecore_Timer* timer); + Ecore_Timer* get_timer(); + private: typedef struct { string appid; diff --git a/plugins/wakeup-manager/src/wakeup_policy_default.cpp b/plugins/wakeup-manager/src/wakeup_policy_default.cpp index e07374c..45b5caa 100644 --- a/plugins/wakeup-manager/src/wakeup_policy_default.cpp +++ b/plugins/wakeup-manager/src/wakeup_policy_default.cpp @@ -45,12 +45,28 @@ void CWakeupPolicyDefault::set_delay(float seconds) mDelaySeconds = seconds; } +float CWakeupPolicyDefault::get_delay() +{ + return mDelaySeconds; +} + +void CWakeupPolicyDefault::set_timer(Ecore_Timer* timer) +{ + mTimer = timer; +} + +Ecore_Timer* CWakeupPolicyDefault::get_timer() +{ + return mTimer; +} + static Eina_Bool timer_func(void *data) { LOGD("[ENTER]"); if (data) { CWakeupPolicyDefault *policy = static_cast(data); policy->timer_expired(); + policy->set_timer(nullptr); } return ECORE_CALLBACK_CANCEL; } @@ -59,11 +75,13 @@ void CWakeupPolicyDefault::wakeup_candidate(mas_wakeup_event_info wakeup_info) { mWakeupInfos.push_back(wakeup_info); if (nullptr == mTimer) { - LOGD("Begin Ecore Thread Main Loop"); - ecore_thread_main_loop_begin(); - mTimer = ecore_timer_add(mDelaySeconds, timer_func, this); - LOGD("End Ecore Thread Main Loop"); - ecore_thread_main_loop_end(); + ecore_main_loop_thread_safe_call_async([](void* data) { + CWakeupPolicyDefault* policy = static_cast(data); + if (!policy) return; + + Ecore_Timer* timer = ecore_timer_add(policy->get_delay(), timer_func, data); + policy->set_timer(timer); + }, this); } } -- 2.7.4 From e667ff3d7f76ec4daf1c2f8cdd7defe789ae9647 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Wed, 22 Jul 2020 16:49:01 +0900 Subject: [PATCH 11/16] Bump version to 0.3.4 Change-Id: I07a09e3abf3283bd5e737bbb7682b689c6a6d204 --- 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 2a18a99..83153e1 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 10c9ac5..4781812 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.3 +Version: 0.3.4 Release: 1 Group: Graphics & UI Framework/Voice Framework License: Flora-1.1 -- 2.7.4 From 894ba9867035e67eda19e35f17e105f36cef911b Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Wed, 22 Jul 2020 17:21:24 +0900 Subject: [PATCH 12/16] Bump version to 0.2.36 Change-Id: Idf77f083e501e14f1c5b00f802cc01c60a929754 --- 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 c012fe7..13cc8d2 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 5288e81..495fec1 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.35 +Version: 0.2.36 Release: 1 Group: Graphics & UI Framework/Voice Framework License: Flora-1.1 -- 2.7.4 From 111600c4d88fdc3ae398b1cd0bc2a840b32ffa7e Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Mon, 3 Aug 2020 16:36:48 +0900 Subject: [PATCH 13/16] Fix bug assigning a newly created variable's value to itself Change-Id: I4ed18c047de2d7747193bf7296984eb2d782f70b --- src/service_plugin.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/service_plugin.cpp b/src/service_plugin.cpp index fe05b22..ca4416c 100644 --- a/src/service_plugin.cpp +++ b/src/service_plugin.cpp @@ -157,6 +157,7 @@ static void process_wakeup_event_by_word_timer(void* data) char* wakeup_word = static_cast(param->data); const char* appid = nullptr; + int id = param->id; CServicePlugin* plugin = param->plugin; CServiceMain* service_main = nullptr; @@ -174,7 +175,7 @@ static void process_wakeup_event_by_word_timer(void* data) if (service_main && appid) { param = new(std::nothrow) AsyncParam; if (param) { - param->id = param->id; + param->id = id; param->data = static_cast(strdup(appid)); param->plugin = plugin; process_wakeup_event_by_appid_timer(static_cast(param)); -- 2.7.4 From 6b26929dd1f6dc252d3fe89e6532aab4724b4743 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Mon, 3 Aug 2020 16:37:48 +0900 Subject: [PATCH 14/16] Bump version to 0.3.5 Change-Id: Ic80e59952a36c16b2f0f0508d880a83de78419d0 --- 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 83153e1..e7ec256 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 4781812..1aa7b5c 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.4 +Version: 0.3.5 Release: 1 Group: Graphics & UI Framework/Voice Framework License: Flora-1.1 -- 2.7.4 From fe16d7610ebe5d86ec24df523118ab1bfaf0cb96 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Fri, 7 Aug 2020 15:25:06 +0900 Subject: [PATCH 15/16] Fix bug NULL is passed on streaming failure event Change-Id: I5b2900a9110d10051bfa028deb0ab5adf5f24a4e --- src/service_plugin.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/service_plugin.cpp b/src/service_plugin.cpp index ca4416c..254fb8e 100644 --- a/src/service_plugin.cpp +++ b/src/service_plugin.cpp @@ -350,8 +350,15 @@ void handle_speech_streaming_event_failure(void* data) static void __audio_streaming_cb(mas_speech_streaming_event_e event, void* buffer, int len, void *user_data) { + CServicePlugin* plugin = static_cast(user_data); + if (event == MAS_SPEECH_STREAMING_EVENT_FAIL) { - ecore_main_loop_thread_safe_call_async(handle_speech_streaming_event_failure, NULL); + AsyncParam* param = new(std::nothrow) AsyncParam; + if (param) { + param->plugin = plugin; + ecore_main_loop_thread_safe_call_async( + handle_speech_streaming_event_failure, static_cast(param)); + } return; } static int count = 0; @@ -361,7 +368,6 @@ static void __audio_streaming_cb(mas_speech_streaming_event_e event, void* buffe } ++count; - CServicePlugin* plugin = static_cast(user_data); CServiceIpcDbus* service_ipc = nullptr; CServiceMain* service_main = nullptr; if (plugin) { -- 2.7.4 From acb7991ffb6361917e8923ac1fbadac98a3c9be1 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Fri, 7 Aug 2020 15:26:03 +0900 Subject: [PATCH 16/16] Bump version to 0.3.6 Change-Id: Ibe2072f0b0d6b81c8d110d45ec41e25a3e456cc2 --- 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 e7ec256..7ac0e5a 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 1aa7b5c..6957ade 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.5 +Version: 0.3.6 Release: 1 Group: Graphics & UI Framework/Voice Framework License: Flora-1.1 -- 2.7.4