Modified not to restart the daemon repeatedly 33/282233/2
authorInHong Han <inhong1.han@samsung.com>
Thu, 29 Sep 2022 00:59:16 +0000 (09:59 +0900)
committerInHong Han <inhong1.han@samsung.com>
Thu, 29 Sep 2022 04:34:11 +0000 (13:34 +0900)
Change-Id: I4fd0822ac19d5cd010a39afe79410e13f4162805

plugins/wakeup-manager/src/wakeup_settings.cpp

index e501e318ae66bd7bf29ae32b3b57982396b75a5c..d88d81b03343ec9e89264b166fc1b48a24c12d00 100644 (file)
@@ -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<CWakeupSettings*>(data);
        if (nullptr == settings) return;