From baa2ba2b89004da8b64db912c5d729bb33d4f44c Mon Sep 17 00:00:00 2001 From: InHong Han Date: Thu, 29 Sep 2022 09:59:16 +0900 Subject: [PATCH] Modified not to restart the daemon repeatedly Change-Id: I4fd0822ac19d5cd010a39afe79410e13f4162805 --- plugins/wakeup-manager/src/wakeup_settings.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/plugins/wakeup-manager/src/wakeup_settings.cpp b/plugins/wakeup-manager/src/wakeup_settings.cpp index e501e31..d88d81b 100644 --- a/plugins/wakeup-manager/src/wakeup_settings.cpp +++ b/plugins/wakeup-manager/src/wakeup_settings.cpp @@ -17,6 +17,8 @@ static auto contains(const C& v, const T& x) -> decltype(end(v), true) return end(v) != find(begin(v), end(v), x); } +static string prev_wake_word_enabled; + CWakeupSettings::CWakeupSettings() { } @@ -147,6 +149,16 @@ static void wakeup_setting_enabled_wake_word_detection_changed_cb(keynode_t* nod { MWR_LOGD("[ENTER]"); + char *vconf_str = vconf_keynode_get_str(node); + if (!vconf_str) return; + + MWR_LOGI("vconf value : %s", vconf_str); + if (0 == prev_wake_word_enabled.compare(string(vconf_str))) { + return; + } + + prev_wake_word_enabled = string(vconf_str); + CWakeupSettings* settings = static_cast(data); if (nullptr == settings) return; -- 2.34.1