Ignore enabled assistants setting in single mode 20/216220/1
authorJi-hoon Lee <dalton.lee@samsung.com>
Tue, 22 Oct 2019 09:09:05 +0000 (18:09 +0900)
committerJi-hoon Lee <dalton.lee@samsung.com>
Tue, 22 Oct 2019 09:09:05 +0000 (18:09 +0900)
Change-Id: If8832442ec3c9cfd56f8823a5c0636f284190132

plugins/wakeup-manager/inc/wakeup_settings.h
plugins/wakeup-manager/src/wakeup_settings.cpp

index 99c8fd1..13ecbb4 100644 (file)
@@ -80,7 +80,7 @@ private:
        string mDefaultAssistantAppid;
        bool mUiPanelEnabled{true};
        float mConversationTimeout{5.0};
-       bool mMultipleMode{true};
+       bool mMultipleMode{false};
        vector<string> mEnabledAssistants;
        float mWakeupPolicyDelay{0.1};
        vector<string> mWakeupPolicyPriority; // No priority by default
index c68d6ba..96a006f 100644 (file)
@@ -161,24 +161,26 @@ void CWakeupSettings::initialize()
                mMultipleMode = vconf_bool;
                MWR_LOGD("multiple_mode : %s", (mMultipleMode ? "true" : "false"));
        }
-       vconf_str = vconf_get_str(WAKEUP_SETTINGS_KEY_ENABLED_ASSISTANTS);
-       if (vconf_str) {
-               string token;
-               istringstream iss(vconf_str);
-               mEnabledAssistants.clear();
-               while (getline(iss, token, ';')) {
-                       mEnabledAssistants.push_back(token);
-                       MWR_LOGD("enabled_assistants : %s", token.c_str());
-                       for (const auto& observer : mObservers) {
-                               if (observer) {
-                                       if (!observer->on_assistant_enabled_info_changed(token.c_str(), true)) {
-                                               LOGW("[Settings WARNING] One of the observer returned false");
+       if (true == mMultipleMode) {
+               vconf_str = vconf_get_str(WAKEUP_SETTINGS_KEY_ENABLED_ASSISTANTS);
+               if (vconf_str) {
+                       string token;
+                       istringstream iss(vconf_str);
+                       mEnabledAssistants.clear();
+                       while (getline(iss, token, ';')) {
+                               mEnabledAssistants.push_back(token);
+                               MWR_LOGD("enabled_assistants : %s", token.c_str());
+                               for (const auto& observer : mObservers) {
+                                       if (observer) {
+                                               if (!observer->on_assistant_enabled_info_changed(token.c_str(), true)) {
+                                                       LOGW("[Settings WARNING] One of the observer returned false");
+                                               }
                                        }
                                }
                        }
+                       free(vconf_str);
+                       vconf_str = nullptr;
                }
-               free(vconf_str);
-               vconf_str = nullptr;
        }
        vconf_ret = vconf_get_dbl(WAKEUP_SETTINGS_KEY_WAKEUP_POLICY_DELAY, &vconf_double);
        if (0 == vconf_ret) {
@@ -219,17 +221,21 @@ void CWakeupSettings::initialize()
 
        vconf_notify_key_changed(WAKEUP_SETTINGS_KEY_VOICE_INPUT_LANGUAGE,
                wakeup_setting_input_language_changed_cb, this);
-       vconf_notify_key_changed(WAKEUP_SETTINGS_KEY_ENABLED_ASSISTANTS,
-               wakeup_setting_enabled_assistants_changed_cb, this);
        vconf_notify_key_changed(WAKEUP_SETTINGS_KEY_DEFAULT_ASSISTANT_APPID,
                wakeup_setting_default_assistant_appid_changed_cb, this);
+       if (true == mMultipleMode) {
+               vconf_notify_key_changed(WAKEUP_SETTINGS_KEY_ENABLED_ASSISTANTS,
+                       wakeup_setting_enabled_assistants_changed_cb, this);
+       }
 }
 
 void CWakeupSettings::deinitialize()
 {
        vconf_ignore_key_changed(WAKEUP_SETTINGS_KEY_VOICE_INPUT_LANGUAGE, NULL);
-       vconf_ignore_key_changed(WAKEUP_SETTINGS_KEY_ENABLED_ASSISTANTS, NULL);
        vconf_ignore_key_changed(WAKEUP_SETTINGS_KEY_DEFAULT_ASSISTANT_APPID, NULL);
+       if (true == mMultipleMode) {
+               vconf_ignore_key_changed(WAKEUP_SETTINGS_KEY_ENABLED_ASSISTANTS, NULL);
+       }
 }
 
 void CWakeupSettings::subscribe(ISettingsEventObserver *observer)