From: Ji-hoon Lee Date: Thu, 21 Mar 2019 02:47:40 +0000 (+0900) Subject: Select wakeup engine that has reported wakeup event X-Git-Tag: submit/tizen/20190418.072452~18 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4bb891ef7f27ab112a26aa8f954c04155cd1d48d;p=platform%2Fcore%2Fuifw%2Fwakeup-engine-default.git Select wakeup engine that has reported wakeup event Change-Id: I8b7698361aa8a6c5279e6e62615046f3148280e0 --- diff --git a/plugins/wakeup-manager/src/wakeup_manager.cpp b/plugins/wakeup-manager/src/wakeup_manager.cpp index c7314ad..3458d89 100644 --- a/plugins/wakeup-manager/src/wakeup_manager.cpp +++ b/plugins/wakeup-manager/src/wakeup_manager.cpp @@ -81,8 +81,7 @@ typedef struct { std::vector assistant_list; } wakeup_engine_info; -//static int g_wakeup_engine_selected = -1; -static int g_wakeup_engine_selected = 0; +static int g_wakeup_engine_selected = -1; static wakeup_engine_info g_wakeup_engine_info[MAX_WAKEUP_ENGINE_NUM]; static char* g_current_language = NULL; @@ -458,6 +457,16 @@ void CWakeupEventObserver::on_wakeup(wakeup_event_info info) { if (NULL != g_wakeup_event_cb) { g_last_wakeup_event_info = info; + for (int loop = 0;loop < g_engine_count;loop++) { + auto iter = std::find( + g_wakeup_engine_info[loop].assistant_list.begin(), + g_wakeup_engine_info[loop].assistant_list.end(), + std::string{info.wakeup_appid}); + if (iter != g_wakeup_engine_info[loop].assistant_list.end()) { + g_wakeup_engine_selected = loop; + MWR_LOGD("Selected : %s", g_wakeup_engine_info[loop].engine_name); + } + } g_wakeup_event_cb(info, g_wakeup_event_user_data); } }