From: Jihoon Kim Date: Fri, 19 Aug 2022 01:57:02 +0000 (+0900) Subject: Add error log in multi-assistant-setting X-Git-Tag: submit/tizen/20220902.072608~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1e3e2fbbda1dc26d6d261f220e7a75afc55aa311;p=platform%2Fcore%2Fuifw%2Fmulti-assistant.git Add error log in multi-assistant-setting Change-Id: Ica8695fcc21af7396f8351b607193c365b7f7d13 Signed-off-by: Jihoon Kim --- diff --git a/common/multi_assistant_settings.c b/common/multi_assistant_settings.c index 39942f2..5847a9c 100644 --- a/common/multi_assistant_settings.c +++ b/common/multi_assistant_settings.c @@ -27,18 +27,25 @@ int ma_settings_is_multiple_mode(bool *multiple) { res = vconf_get_bool(MODE_URL, ¤t_multiple); if (0 == res) { *multiple = current_multiple; + LOGI("multiple mode(%d)", current_multiple); return MA_ERROR_NONE; } else { + LOGE("Operation Failed"); return MA_ERROR_OPERATION_FAILED; } } + + LOGE("Invalid parameter"); return MA_ERROR_INVALID_PARAMETER; } int ma_settings_set_multiple_mode(bool multiple) { if (0 == vconf_set_bool(MODE_URL, multiple)) { + LOGI("multiple mode(%d)", multiple); return MA_ERROR_NONE; } + + LOGE("Operation Failed"); return MA_ERROR_OPERATION_FAILED; } @@ -47,13 +54,16 @@ int ma_settings_get_current_voice_assistant(char** app_id) { int res = MA_ERROR_NONE; res = ma_settings_is_multiple_mode(&multiple); + LOGI("multiple mode(%d)", multiple); if (MA_ERROR_NONE != res) return res; char* previous_assistant = vconf_get_str(DEFAULT_ASSISTANT_URL); if (!multiple && previous_assistant && app_id) { *app_id = previous_assistant; + LOGI("appid: %s", *app_id); res = MA_ERROR_NONE; } else { + LOGE("Operation failed"); res = MA_ERROR_OPERATION_FAILED; if (previous_assistant) free(previous_assistant); } @@ -66,16 +76,19 @@ int ma_settings_change_voice_assistant(const char* app_id) { int res = MA_ERROR_NONE; res = ma_settings_is_multiple_mode(&multiple); + LOGD("multiple mode(%d). Error(%x)", multiple, res); if (MA_ERROR_NONE != res) return res; if (!multiple && app_id) { 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; } - } else { + LOGE("Operation failed"); res = MA_ERROR_OPERATION_FAILED; } @@ -89,6 +102,7 @@ int ma_settings_set_voice_assistant_enabled(const char* app_id, bool enabled) { if (MA_ERROR_NONE != res) return res; if (!multiple) { + LOGE("Not supported"); return MA_ERROR_NOT_SUPPORTED; } if (NULL != app_id) { @@ -97,6 +111,7 @@ int ma_settings_set_voice_assistant_enabled(const char* app_id, bool enabled) { if (NULL != enabled_assistants) { char* tmp = strstr(enabled_assistants, app_id); if (tmp) { + LOGE("Not supported"); res = MA_ERROR_NOT_SUPPORTED; } else { char assistants[MAX_LEN] = ""; @@ -104,10 +119,12 @@ int ma_settings_set_voice_assistant_enabled(const char* app_id, bool enabled) { if (0 == vconf_set_str(ENABLED_ASSISTANT_URL, assistants)) { res = MA_ERROR_NONE; } else { + LOGE("Operation failed"); res = MA_ERROR_OPERATION_FAILED; } } } else { + LOGE("Operation failed"); res = MA_ERROR_OPERATION_FAILED; } } else { @@ -126,6 +143,7 @@ int ma_settings_set_voice_assistant_enabled(const char* app_id, bool enabled) { strncat(assistants, as, strlen(as)); strncat(assistants, ";", 1); } else { + LOGE("Operation failed"); res = MA_ERROR_OPERATION_FAILED; if (enabled_assistants) { free(enabled_assistants); @@ -138,12 +156,15 @@ int ma_settings_set_voice_assistant_enabled(const char* app_id, bool enabled) { if (0 == vconf_set_str(ENABLED_ASSISTANT_URL, assistants)) { res = MA_ERROR_NONE; } else { + LOGE("Operation failed"); res = MA_ERROR_OPERATION_FAILED; } } else { + LOGE("Not support"); res = MA_ERROR_NOT_SUPPORTED; } } else { + LOGE("Operation failed"); res = MA_ERROR_OPERATION_FAILED; } } @@ -151,6 +172,7 @@ int ma_settings_set_voice_assistant_enabled(const char* app_id, bool enabled) { free(enabled_assistants); } } else { + LOGE("Engine not found"); res = MA_ERROR_ENGINE_NOT_FOUND; } return res; @@ -161,16 +183,22 @@ int ma_settings_get_default_voice_assistant(char** app_id) { int res = MA_ERROR_NONE; res = ma_settings_is_multiple_mode(&multiple); + LOGD("multiple mode(%d). Error(%x)", multiple, res); + if (MA_ERROR_NONE != res) return res; char* previous_assistant = vconf_get_str(DEFAULT_ASSISTANT_URL); if (multiple && previous_assistant && app_id) { *app_id = previous_assistant; + LOGI("Succeeded. app id(%s)", *app_id); res = MA_ERROR_NONE; } else { res = MA_ERROR_OPERATION_FAILED; + LOGE("Operation failed"); if (previous_assistant) free(previous_assistant); } + + LOGD("error(%x)", res); return res; } @@ -179,17 +207,21 @@ int ma_settings_set_default_voice_assistant(const char* app_id) { int res = MA_ERROR_NONE; res = ma_settings_is_multiple_mode(&multiple); + LOGD("multiple mode(%d). Error(%x)", multiple, res); if (MA_ERROR_NONE != res) return res; if (multiple && app_id) { if (0 == vconf_set_str(DEFAULT_ASSISTANT_URL, app_id)) { + LOGI("Succeeded. app id(%s)", app_id); res = MA_ERROR_NONE; } else { + LOGE("Operation failed"); res = MA_ERROR_OPERATION_FAILED; } } else { + LOGE("Operation failed"); res = MA_ERROR_OPERATION_FAILED; } return res; } -//LCOV_EXCL_STOP \ No newline at end of file +//LCOV_EXCL_STOP