}
int ma_settings_change_voice_assistant(const char* app_id) {
- bool multiple = false;
int res = MA_ERROR_NONE;
if (!app_id) {
return MA_ERROR_INVALID_PARAMETER;
}
- res = ma_settings_is_multiple_mode(&multiple);
- LOGD("multiple mode(%d). Error(%x)", multiple, res);
- if (MA_ERROR_NONE != res) return res;
-
- if (!multiple) {
- if (0 == vconf_set_str(DEFAULT_ASSISTANT_URL, app_id)) {
- LOGI("appid: %s", app_id);
- res = MA_ERROR_NONE;
- } else {
- LOGE("Operation failed");
- res = MA_ERROR_OPERATION_FAILED;
- }
+ if (0 == vconf_set_str(DEFAULT_ASSISTANT_URL, app_id)) {
+ LOGI("appid: %s", app_id);
+ res = MA_ERROR_NONE;
} else {
LOGE("Operation failed");
res = MA_ERROR_OPERATION_FAILED;
if (NULL != enabled_assistants) {
char* tmp = strstr(enabled_assistants, app_id);
if (tmp) {
- LOGE("Not supported");
- res = MA_ERROR_NOT_SUPPORTED;
+ LOGI("Already set as ENABLED : %s", app_id);
+ res = MA_ERROR_NONE;
} else {
char assistants[MAX_LEN] = "";
snprintf(assistants, MAX_LEN, "%s%s;", enabled_assistants, app_id);
}
}
} else {
- LOGE("Operation failed");
+ LOGE("Operation failed : Could not get vconf value");
res = MA_ERROR_OPERATION_FAILED;
}
} else {
EXPECT_EQ(ret, MA_ERROR_INVALID_PARAMETER);
}
-TEST_F(MultiAssistantSettingMultipleOnTest, utc_ma_settings_change_voice_assistant_operation_failed)
+TEST_F(MultiAssistantSettingMultipleOnTest, utc_ma_settings_change_voice_assistant_error_none)
{
int ret = ma_settings_change_voice_assistant(TEST_VOICE_ASSISTANT_APPID);
- EXPECT_EQ(ret, MA_ERROR_OPERATION_FAILED);
+ EXPECT_EQ(ret, MA_ERROR_NONE);
}
TEST_F(MultiAssistantSettingMultipleOnTest, utc_ma_settings_get_voice_assistant_enabled_invalid_parameter)