From: Ji-hoon Lee Date: Tue, 22 Oct 2019 09:09:05 +0000 (+0900) Subject: Ignore enabled assistants setting in single mode X-Git-Tag: submit/tizen/20191022.091645~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=63461547d0e4d312920a8afce5d3666c816a608d;p=platform%2Fcore%2Fuifw%2Fmulti-assistant-service.git Ignore enabled assistants setting in single mode Change-Id: If8832442ec3c9cfd56f8823a5c0636f284190132 --- diff --git a/plugins/wakeup-manager/inc/wakeup_settings.h b/plugins/wakeup-manager/inc/wakeup_settings.h index 99c8fd1..13ecbb4 100644 --- a/plugins/wakeup-manager/inc/wakeup_settings.h +++ b/plugins/wakeup-manager/inc/wakeup_settings.h @@ -80,7 +80,7 @@ private: string mDefaultAssistantAppid; bool mUiPanelEnabled{true}; float mConversationTimeout{5.0}; - bool mMultipleMode{true}; + bool mMultipleMode{false}; vector mEnabledAssistants; float mWakeupPolicyDelay{0.1}; vector mWakeupPolicyPriority; // No priority by default diff --git a/plugins/wakeup-manager/src/wakeup_settings.cpp b/plugins/wakeup-manager/src/wakeup_settings.cpp index c68d6ba..96a006f 100644 --- a/plugins/wakeup-manager/src/wakeup_settings.cpp +++ b/plugins/wakeup-manager/src/wakeup_settings.cpp @@ -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)