Change a default value of auto-language and Add more logs 20/317020/1
authorVBS <sooyeon.kim@samsung.com>
Mon, 23 Dec 2024 07:55:46 +0000 (16:55 +0900)
committerVBS <sooyeon.kim@samsung.com>
Mon, 23 Dec 2024 07:55:46 +0000 (16:55 +0900)
Change-Id: Ie1acea23b1cb1df930859dfae0968f2200142885
Signed-off-by: VBS <sooyeon.kim@samsung.com>
client/vc_setting.c
common/vc_config_mgr.cpp
common/vc_config_parser.c
vc-config.xml

index 999c7162669197d5d89ba288014d73d552992fc4..8ddfb75556b96bf5a0283d11f0e58b7dc40d4e6b 100644 (file)
@@ -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");
index 1b9848663298e52b9d1330b30425ca3d4b319a33..5c401d6704866e7b37cb5bead3aa08e0da1f985d 100644 (file)
@@ -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");
index fbc1eccb18420e83a63b287bfe06806f44ca6531..2b0447c133f8e03423613321f1bc9828688d8e0c 100644 (file)
@@ -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);
                                                }
index 733b8b6c31a5c42d93cd1193e82b47a3174ccd4e..4eaa1e595108921da960c66d39f826b02dcc00a6 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <voice-control-config>
         <engine>C7AEDE1D-90F7-41ea-9AB4-FD99966D2654</engine>
-        <auto>on</auto>
+        <auto>off</auto>
         <language>en_US</language>
         <enabled>on</enabled>
 </voice-control-config>