summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJi-hoon Lee <dalton.lee@samsung.com>2023-01-10 18:01:05 +0900
committerJi-hoon Lee <dalton.lee@samsung.com>2023-01-10 18:01:05 +0900
commita2f86ed4e4dbaa541a6155f65675990aa857c5d8 (patch)
treecbf23ba0fd95753610586ef042173f0bdf54c5a0
parente55ec1a524fe9242bc71a0f7a375c938d3e0ecab (diff)
parentb7d1b7541e2c4ef9e2b5076bbba641714ce97c43 (diff)
downloadmulti-assistant-service-a2f86ed4e4dbaa541a6155f65675990aa857c5d8.tar.gz
multi-assistant-service-a2f86ed4e4dbaa541a6155f65675990aa857c5d8.tar.bz2
multi-assistant-service-a2f86ed4e4dbaa541a6155f65675990aa857c5d8.zip
Change-Id: I660f2fc3bc11d35efa5b3a4934efc80d76e277a1
-rw-r--r--inc/service_plugin.h11
-rw-r--r--org.tizen.multi-assistant-service.xml2
-rw-r--r--packaging/org.tizen.multi-assistant-service.spec2
-rw-r--r--plugins/wakeup-manager/src/wakeup_manager.cpp8
-rw-r--r--src/service_ipc_dbus.cpp12
-rw-r--r--src/service_plugin.cpp40
6 files changed, 57 insertions, 18 deletions
diff --git a/inc/service_plugin.h b/inc/service_plugin.h
index 69d081c..6a4691d 100644
--- a/inc/service_plugin.h
+++ b/inc/service_plugin.h
@@ -81,8 +81,11 @@ public:
void set_service_ipc(CServiceIpcDbus* ipc) { mServiceIpc = ipc; }
CServiceIpcDbus* get_service_ipc() { return mServiceIpc; }
- void set_service_main(CServiceMain* main) { mServiceMain = main; }
- CServiceMain* get_service_main() { return mServiceMain; }
+ void set_service_main(CServiceMain* main) { mServiceMain = main; }
+ CServiceMain* get_service_main() { return mServiceMain; }
+
+ void start_app_restart_timer();
+ void stop_app_restart_timer();
private:
#ifdef BUF_SAVE_MODE
char mDumpFilename[128]{'\0', };
@@ -96,7 +99,9 @@ private:
ma_plugin_settings* mPluginSettings{NULL};
CServiceIpcDbus* mServiceIpc{nullptr};
- CServiceMain* mServiceMain{nullptr};
+ CServiceMain* mServiceMain{nullptr};
+
+ Ecore_Timer *mAppRestartTimer{nullptr};
};
#endif /* __SERVICE_PLUGIN_H__ */
diff --git a/org.tizen.multi-assistant-service.xml b/org.tizen.multi-assistant-service.xml
index dda7e64..d3d4f57 100644
--- a/org.tizen.multi-assistant-service.xml
+++ b/org.tizen.multi-assistant-service.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
-<manifest xmlns="http://tizen.org/ns/packages" api-version="5.0" package="org.tizen.multi-assistant-service" version="0.3.37">
+<manifest xmlns="http://tizen.org/ns/packages" api-version="5.0" package="org.tizen.multi-assistant-service" version="0.3.38">
<label>Multi Assistant Service</label>
<author email="wn.jang@samsung.com" href="www.samsung.com">Won Nam Jang</author>
<author email="sooyeon.kim@samsung.com" href="www.samsung.com">Sooyeon Kim</author>
diff --git a/packaging/org.tizen.multi-assistant-service.spec b/packaging/org.tizen.multi-assistant-service.spec
index ea0576e..42d6a1b 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.37
+Version: 0.3.38
Release: 1
Group: Graphics & UI Framework/Voice Framework
License: Flora-1.1
diff --git a/plugins/wakeup-manager/src/wakeup_manager.cpp b/plugins/wakeup-manager/src/wakeup_manager.cpp
index 5b6271e..516669f 100644
--- a/plugins/wakeup-manager/src/wakeup_manager.cpp
+++ b/plugins/wakeup-manager/src/wakeup_manager.cpp
@@ -828,11 +828,9 @@ bool CWakeupManager::start_streaming_utterance_data()
{
MWR_LOGI("[ENTER]");
- if (mStreamingMode == STREAMING_MODE::UTTERANCE) {
- if (mCurrentStreamingSessionID == mLastWakeupEventID) {
- MWR_LOGW("Streaming already started for this session");
- return false;
- }
+ if (mCurrentStreamingSessionID == mLastWakeupEventID) {
+ MWR_LOGW("Streaming already started for this session");
+ return false;
}
mCurrentStreamingSessionID = mLastWakeupEventID;
diff --git a/src/service_ipc_dbus.cpp b/src/service_ipc_dbus.cpp
index 3114dc5..365c3b8 100644
--- a/src/service_ipc_dbus.cpp
+++ b/src/service_ipc_dbus.cpp
@@ -60,12 +60,12 @@ static void message_port_cb(int local_port_id,
return;
}
- char *request = nullptr;
- bundle_get_str(message, "request", &request);
- if (request) {
- const char *szStartStreamingRequest = "start_streaming_current_utterance";
- if (strncmp(request, szStartStreamingRequest, strlen(szStartStreamingRequest)) == 0) {
- MAS_LOGE("start_streaming request");
+ char *command = nullptr;
+ bundle_get_str(message, "command", &command);
+ if (command) {
+ const char *szStartStreamingCommand = "start_streaming_current_utterance";
+ if (strncmp(command, szStartStreamingCommand, strlen(szStartStreamingCommand)) == 0) {
+ MAS_LOGE("AP sent start streaming request");
observer->on_ap_start_streaming_audio_data(std::string{remote_app_id},
MA_AUDIO_STREAMING_DATA_TYPE_CURRENT_UTTERANCE);
}
diff --git a/src/service_plugin.cpp b/src/service_plugin.cpp
index 3f3ba2a..2b8e8da 100644
--- a/src/service_plugin.cpp
+++ b/src/service_plugin.cpp
@@ -643,6 +643,37 @@ static void __wakeup_service_voice_key_status_changed_cb(ma_voice_key_status_e s
}
}
+static Eina_Bool app_restart_timer_func(void *user_data)
+{
+ CServicePlugin *plugin = static_cast<CServicePlugin*>(user_data);
+ if (plugin) {
+ CServiceMain* service_main = plugin->get_service_main();
+ if (service_main) {
+ ma_service_state_e service_state = service_main->get_current_service_state();
+ if (service_state != MA_SERVICE_STATE_UTTERANCE) {
+ MAS_LOGE("[SUCCESS] Restarting service");
+ service_main->app_restart();
+ }
+ }
+ }
+
+ return ECORE_CALLBACK_RENEW;
+}
+
+void CServicePlugin::stop_app_restart_timer()
+{
+ if (mAppRestartTimer) {
+ ecore_timer_del(mAppRestartTimer);
+ mAppRestartTimer = nullptr;
+ }
+}
+
+void CServicePlugin::start_app_restart_timer()
+{
+ stop_app_restart_timer();
+ mAppRestartTimer = ecore_timer_add(1.0f, app_restart_timer_func, this);
+}
+
static void __loaded_engine_changed_cb(void* user_data)
{
MAS_LOGD("[SUCCESS] __loaded_engine_changed_cb is called");
@@ -654,12 +685,12 @@ static void __loaded_engine_changed_cb(void* user_data)
if (service_main) {
/* Make sure the app doesn't restart within a conversation session */
ma_service_state_e service_state = service_main->get_current_service_state();
- if (service_state == MA_SERVICE_STATE_INACTIVE ||
- service_state == MA_SERVICE_STATE_LISTENING) {
+ if (service_state != MA_SERVICE_STATE_UTTERANCE) {
MAS_LOGE("[SUCCESS] Restarting service");
service_main->app_restart();
} else {
MAS_LOGE("Cannot restart service when service_state is %d", service_state);
+ plugin->start_app_restart_timer();
}
}
}
@@ -855,6 +886,11 @@ int CServicePlugin::deinitialize(void)
}
#endif
+ if (mAppRestartTimer) {
+ ecore_timer_del(mAppRestartTimer);
+ mAppRestartTimer = nullptr;
+ }
+
int ret = -1;
if (NULL != mPluginHandle) {
wakeup_manager_deinitialize func = mWakeupManagerInterface.deinitialize;