From: Suyeon Hwang Date: Thu, 13 Oct 2022 07:45:49 +0000 (+0900) Subject: Set engine id from vconf value when default config is set X-Git-Tag: accepted/tizen/7.0/unified/20230106.165639~3^2~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=aece4f1762f3be41292ae54b62fa59f772c5383d;p=platform%2Fcore%2Fuifw%2Ftts.git Set engine id from vconf value when default config is set - Issue: When default configuration is loaded, invalid engine id can be set. - Solution: Default configuration stores fixed engine id, so the engine id can be not installed in the image. Thus, this patch changes the logic for loading default configuration. Through this patch, vconf value is used default engine id when default configuration is loaded. Change-Id: Ifa37d1eceb5df126b69ac7455aea0dc0e12005fa Signed-off-by: Suyeon Hwang --- diff --git a/common/tts_config_parser.c b/common/tts_config_parser.c index a0ba63ed..6e33df24 100644 --- a/common/tts_config_parser.c +++ b/common/tts_config_parser.c @@ -443,6 +443,21 @@ int tts_parser_load_config(void) while (cur != NULL) { if (0 == xmlStrcmp(cur->name, (const xmlChar *)TTS_TAG_CONFIG_ENGINE_ID)) { + if (is_default_open) { + char* engine_id = vconf_get_str(TTS_ENGINE_DB_DEFAULT); + if (engine_id) { + SLOG(LOG_DEBUG, TAG_TTSCONFIG, "Set default engine id(%s)", engine_id); + strncpy(temp->engine_id, engine_id, sizeof(engine_id) - 1); + xmlNodeSetContent(cur, (const xmlChar *)engine_id); + + free(engine_id); + engine_id = NULL; + + cur = cur->next; + continue; + } + } + key = xmlNodeGetContent(cur); if (NULL != key) { strncpy(temp->engine_id, (char*)key, sizeof(g_engine_id) - 1); @@ -1139,6 +1154,11 @@ int tts_parser_reset() return -1; } + char* engine_id = vconf_get_str(TTS_ENGINE_DB_DEFAULT); + if (engine_id) { + __set_value_into_configuration(TTS_TAG_CONFIG_ENGINE_ID, engine_id); + free(engine_id); + } __save_configuration(g_config_doc); return 0; diff --git a/tts-config.xml b/tts-config.xml index cb77be76..9d2696f1 100644 --- a/tts-config.xml +++ b/tts-config.xml @@ -1,6 +1,6 @@ - 27F277E9-BBC4-4dca-B553-D9884A3CDAA0 + org.tizen.tts-engine-default on en_US