From aa51de5c89d05b8ab3380fe10116f077b8cbfc73 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Wed, 20 Mar 2019 14:03:04 +0900 Subject: [PATCH] Make assistant-specific commands to be delivered to appropriate engine Change-Id: I96eabef58a1a22e982efffb8da9e53b56d757f6b --- plugins/wakeup-manager/src/wakeup_manager.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/plugins/wakeup-manager/src/wakeup_manager.cpp b/plugins/wakeup-manager/src/wakeup_manager.cpp index 2aa267a..9e4c766 100644 --- a/plugins/wakeup-manager/src/wakeup_manager.cpp +++ b/plugins/wakeup-manager/src/wakeup_manager.cpp @@ -751,11 +751,14 @@ int wakeup_manager_send_assistant_specific_command(const char* appid, const char } for (int loop = 0;loop < g_engine_count;loop++) { - /* Need to find the appropriate engine for this assistant, - for now assuming 0 is the one */ - if(loop == 0) { + auto iter = std::find( + g_wakeup_engine_info[loop].assistant_list.begin(), + g_wakeup_engine_info[loop].assistant_list.end(), + std::string{appid}); + if (iter != g_wakeup_engine_info[loop].assistant_list.end()) { if (g_wakeup_engine_info[loop].interface.set_assistant_specific_command) { - g_wakeup_engine_info[loop].interface.set_assistant_specific_command(appid, command); + g_wakeup_engine_info[loop].interface.set_assistant_specific_command( + appid, command); } } } -- 2.34.1