From: dyamy-lee Date: Fri, 26 Jul 2024 08:56:52 +0000 (+0900) Subject: change the way of getting engine_id when updating personal voice X-Git-Tag: accepted/tizen/unified/20240930.043752~22 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=155d8c774626a5275f1b29c2f5998f3479ba3c3e;p=platform%2Fcore%2Fuifw%2Ftts.git change the way of getting engine_id when updating personal voice When calling ttsd_config_update_personal_voice(), it gets engine_id by checking current engine from app_id. So, tts_config_mgr_update_personal_voice() API uses this input parameter. Not use default engine id. Change-Id: If04861cc4c5faf69f5146c6d64bd862d67e48a1d --- diff --git a/common/tts_config_mgr.c b/common/tts_config_mgr.c index 65ebd96b..fbe5dc07 100644 --- a/common/tts_config_mgr.c +++ b/common/tts_config_mgr.c @@ -2431,18 +2431,8 @@ int tts_config_mgr_set_instant_reprepare_client(const unsigned int uid) int tts_config_mgr_update_personal_voice(const char* engine_id, const char* language, const char* unique_id, const char* display_name, const char* device_name) { - char* default_engine = get_default_engine_app_id(); - // tts_engine_info_s *engine_info = __get_engine_info(default_engine); - // free(default_engine); - // if (NULL == engine_info) { - // SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] engine info is NULL"); - // return TTS_CONFIG_ERROR_ENGINE_NOT_FOUND; - // } - - engine_id = strdup(default_engine); + SLOG(LOG_DEBUG, TAG_TTSCONFIG, "[DEBUG] engine_id(%s) language(%s), unique_id(%s), display_name(%s), device_name(%s)", engine_id, language, unique_id, display_name, device_name); - SLOG(LOG_DEBUG, TAG_TTSCONFIG, "[DEBUG] engine id = %s", engine_id); - SLOG(LOG_DEBUG, TAG_TTSCONFIG, "[DEBUG] language(%s), unique_id(%s), display_name(%s), device_name(%s)", language, unique_id, display_name, device_name); if (NULL == engine_id || NULL == language || NULL == unique_id || NULL == display_name || NULL == device_name) { SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] Input Parameter is null"); return TTS_CONFIG_ERROR_INVALID_PARAMETER; diff --git a/server/ttsd_config.c b/server/ttsd_config.c index 67352bb8..13cbbbc7 100644 --- a/server/ttsd_config.c +++ b/server/ttsd_config.c @@ -14,6 +14,7 @@ /* For multi-user support */ #include +#include #include "tts_config_mgr.h" #include "ttsd_config.h" @@ -265,13 +266,14 @@ int ttsd_config_set_instant_reprepare_client(const unsigned int uid) int ttsd_config_update_personal_voice(const char* language, const char* unique_id, const char* display_name, const char* device_name, void* user_data) { - char* engine_id = NULL; - // if (0 != tts_config_mgr_get_engine(&engine_id)) { - // SLOG(LOG_ERROR, tts_tag(), "[Config ERROR] Fail to get engine id"); - // return TTSD_ERROR_OPERATION_FAILED; - // } + char current_engine[1024] = {'\0', }; + if (0 != aul_app_get_appid_bypid(getpid(), current_engine, sizeof(current_engine) - 1)) { + SLOG(LOG_ERROR, tts_tag(), "[Server ERROR] Fail to get callee appid by pid"); + } + + SLOG(LOG_DEBUG, tts_tag(), "[Server] TTS Current Engine(%s)", current_engine); - int ret = tts_config_mgr_update_personal_voice(engine_id, language, unique_id, display_name, device_name); + int ret = tts_config_mgr_update_personal_voice(current_engine, language, unique_id, display_name, device_name); if (0 != ret) { SLOG(LOG_ERROR, tts_tag(), "[Config ERROR] Fail to update personal voice to xml"); return TTSD_ERROR_OPERATION_FAILED;