From: Ji-hoon Lee Date: Wed, 20 Mar 2019 05:03:04 +0000 (+0900) Subject: Make assistant-specific commands to be delivered to appropriate engine X-Git-Tag: submit/tizen/20190418.072452~20 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=aa51de5c89d05b8ab3380fe10116f077b8cbfc73;p=platform%2Fcore%2Fuifw%2Fwakeup-engine-default.git Make assistant-specific commands to be delivered to appropriate engine Change-Id: I96eabef58a1a22e982efffb8da9e53b56d757f6b --- 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); } } }