Merge branch 'tizen_5.5' into tizen
[platform/core/uifw/multi-assistant-service.git] / plugins / wakeup-manager / src / wakeup_engine_manager.cpp
index d9181dc..aa7981f 100644 (file)
@@ -570,6 +570,27 @@ void CWakeupEngineManager::engine_add_wakeup_word(string appid, string wakeup_wo
                                        MWR_LOGE("[ERROR] wakeup engine %s threw exception : %s",
                                                info.engine_name.c_str(), e.what());
                                }
+                       } else {
+                               MWR_LOGE("Wakeup Engine does not provide add_wakeup_word");
+                       }
+               }
+       }
+}
+
+void CWakeupEngineManager::engine_remove_wakeup_word(string appid, string wakeup_word, string language)
+{
+       for (const auto& info : mEngineInfo) {
+               bool found = contains(info.assistant_list, appid);
+               if (found) {
+                       if (info.interface.remove_wakeup_word) {
+                               try {
+                                       info.interface.remove_wakeup_word(appid.c_str(), wakeup_word.c_str(), language.c_str());
+                               } catch (const std::exception& e) {
+                                       MWR_LOGE("[ERROR] wakeup engine %s threw exception : %s",
+                                               info.engine_name.c_str(), e.what());
+                               }
+                       } else {
+                               MWR_LOGE("Wakeup Engine does not provide remove_wakeup_word");
                        }
                }
        }
@@ -787,6 +808,9 @@ void CWakeupEngineManager::add_engine(string name, string path)
        info.interface.add_wakeup_word =
                (wakeup_engine_add_wakeup_word)dlsym(info.engine_handle,
                MA_WAKEUP_ENGINE_FUNC_ADD_WAKEUP_WORD);
+       info.interface.remove_wakeup_word =
+               (wakeup_engine_remove_wakeup_word)dlsym(info.engine_handle,
+               MA_WAKEUP_ENGINE_FUNC_REMOVE_WAKEUP_WORD);
        info.interface.add_language =
                (wakeup_engine_add_language)dlsym(info.engine_handle,
                MA_WAKEUP_ENGINE_FUNC_ADD_LANGUAGE);