From 37cd0438da12d69328bd6bfc8d88d22391bede01 Mon Sep 17 00:00:00 2001 From: VBS Date: Mon, 23 Dec 2024 16:55:46 +0900 Subject: [PATCH] Change a default value of auto-language and Add more logs Change-Id: Ie1acea23b1cb1df930859dfae0968f2200142885 Signed-off-by: VBS --- client/vc_setting.c | 8 ++++---- common/vc_config_mgr.cpp | 6 ++++-- common/vc_config_parser.c | 8 ++++---- vc-config.xml | 2 +- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/client/vc_setting.c b/client/vc_setting.c index 999c716..8ddfb75 100644 --- a/client/vc_setting.c +++ b/client/vc_setting.c @@ -190,7 +190,7 @@ int vc_setting_set_engine(const char* engine_appid) if (0 != ret) { SLOG(LOG_ERROR, TAG_VCS, "[ERROR] Result : %d", ret); } else { - SLOG(LOG_DEBUG, TAG_VCS, "[SUCCESS] Set current engine"); + SLOG(LOG_ERROR, TAG_VCS, "[SUCCESS] Set current engine(%s)", engine_appid); } @@ -259,7 +259,7 @@ int vc_setting_set_language(const char* language) SLOG(LOG_DEBUG, TAG_VCS, "[DEBUG] Daemon is not available"); } else { ret = vc_setting_tidl_request_set_language(getpid(), language); - SLOG(LOG_DEBUG, TAG_VCS, "[DEBUG] Set default language (%d)", ret); + SLOG(LOG_ERROR, TAG_VCS, "[DEBUG] Set default language(%s) (%d)", language, ret); } if (0 != vc_setting_tidl_close_connection()) { @@ -288,7 +288,7 @@ int vc_setting_set_auto_language(bool value) if (0 != ret) { SLOG(LOG_ERROR, TAG_VCS, "[ERROR] Result : %d", ret); } else { - SLOG(LOG_DEBUG, TAG_VCS, "[SUCCESS] Set auto language (%s)", value ? "on" : "off"); + SLOG(LOG_ERROR, TAG_VCS, "[SUCCESS] Set auto language (%s)", value ? "on" : "off"); } SLOG(LOG_DEBUG, TAG_VCS, "@@@ Set auto voice DONE"); @@ -331,7 +331,7 @@ int vc_setting_set_enabled(bool value) if (0 != ret) { SLOG(LOG_ERROR, TAG_VCS, "[ERROR] Result : %d", ret); } else { - SLOG(LOG_DEBUG, TAG_VCS, "[SUCCESS] Set service enabled (%s)", value ? "on" : "off"); + SLOG(LOG_ERROR, TAG_VCS, "[SUCCESS] Set service enabled (%s)", value ? "on" : "off"); } SLOG(LOG_DEBUG, TAG_VCS, "@@@ Set service enabled DONE"); diff --git a/common/vc_config_mgr.cpp b/common/vc_config_mgr.cpp index 1b98486..5c401d6 100644 --- a/common/vc_config_mgr.cpp +++ b/common/vc_config_mgr.cpp @@ -736,7 +736,7 @@ static int set_language_by_automatic_selection() return VC_CONFIG_ERROR_OPERATION_FAILED; } - strncpy(candidate_lang, value, 5); + strncpy(candidate_lang, value, 5); // candidate_lang == disply language free(value); SLOG(LOG_DEBUG, vc_config_tag(), "[Config] Display language : %s", candidate_lang); @@ -765,7 +765,9 @@ static int set_language_by_automatic_selection() /* Call all callbacks of client*/ notify_language_changed(before_language.c_str(), candidate_lang); } else { - /* Candidate language is not valid */ + /* TODO: Keep the current language. Get the current language from Config */ + /* Candidate language (display language) is not valid (not supported) */ + SLOG(LOG_WARN, vc_config_tag(), "[Config] Candidate language(%s) is not supported by engine", candidate_lang); char* tmp_language = NULL; if (0 != get_default_language_of_engine(default_engine_id.c_str(), &tmp_language)) { SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Fail to select language"); diff --git a/common/vc_config_parser.c b/common/vc_config_parser.c index fbc1ecc..2b0447c 100644 --- a/common/vc_config_parser.c +++ b/common/vc_config_parser.c @@ -723,7 +723,7 @@ int vc_parser_find_config_changed(int* auto_lang, char** language, char** engine key_new = xmlNodeGetContent(cur_new); if (NULL != key_new) { if (0 != xmlStrcmp(key_old, key_new)) { - SLOG(LOG_DEBUG, vc_config_tag(), "Old auto lang(%s), New auto lang(%s)", (char*)key_old, (char*)key_new); + SLOG(LOG_ERROR, vc_config_tag(), "Old auto lang(%s), New auto lang(%s)", (char*)key_old, (char*)key_new); if (0 == xmlStrcmp(key_new, (const xmlChar*)"on")) { *auto_lang = 1; } else { @@ -744,7 +744,7 @@ int vc_parser_find_config_changed(int* auto_lang, char** language, char** engine key_new = xmlNodeGetContent(cur_new); if (NULL != key_new) { if (0 != xmlStrcmp(key_old, key_new)) { - SLOG(LOG_DEBUG, vc_config_tag(), "Old language(%s), New language(%s)", (char*)key_old, (char*)key_new); + SLOG(LOG_ERROR, vc_config_tag(), "Old language(%s), New language(%s)", (char*)key_old, (char*)key_new); if (NULL != *language) free(*language); *language = strdup((char*)key_new); } @@ -762,7 +762,7 @@ int vc_parser_find_config_changed(int* auto_lang, char** language, char** engine key_new = xmlNodeGetContent(cur_new); if (NULL != key_new) { if (0 != xmlStrcmp(key_old, key_new)) { - SLOG(LOG_DEBUG, vc_config_tag(), "Old enabled(%s), New enabled(%s)", (char*)key_old, (char*)key_new); + SLOG(LOG_ERROR, vc_config_tag(), "Old enabled(%s), New enabled(%s)", (char*)key_old, (char*)key_new); if (0 == xmlStrcmp(key_new, (const xmlChar*)"on")) { *enabled = 1; } else { @@ -783,7 +783,7 @@ int vc_parser_find_config_changed(int* auto_lang, char** language, char** engine key_new = xmlNodeGetContent(cur_new); if (NULL != key_new) { if (0 != xmlStrcmp(key_old, key_new)) { - SLOG(LOG_DEBUG, vc_config_tag(), "Old engine(%s), New engine(%s)", (char*)key_old, (char*)key_new); + SLOG(LOG_ERROR, vc_config_tag(), "Old engine(%s), New engine(%s)", (char*)key_old, (char*)key_new); if (NULL != *engine) free(*engine); *engine = strdup((char*)key_new); } diff --git a/vc-config.xml b/vc-config.xml index 733b8b6..4eaa1e5 100644 --- a/vc-config.xml +++ b/vc-config.xml @@ -1,7 +1,7 @@ C7AEDE1D-90F7-41ea-9AB4-FD99966D2654 - on + off en_US on -- 2.34.1