From: Suyeon Hwang Date: Thu, 20 Apr 2023 02:29:09 +0000 (+0900) Subject: Fix pointer checking condition and owner of config file X-Git-Tag: accepted/tizen/unified/20230425.130131~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eb093d22c2b33d8bd60e542822501393e2e212a3;p=platform%2Fcore%2Fuifw%2Ftts.git Fix pointer checking condition and owner of config file - Issue: tts_setting_set_voice() does not set voice properly. - Solution: Previous code validates the voice with invalid condition. So, the function returns error even if the voice is valid. Meanwhile, the app can not write the config file because of the owner of the file. To resolve these issues, this patch fixes the checking condition and owner of config file. Through this patch, the function will properly set the voice. To resolve this issue, this patch fixes the condition as a right way. Change-Id: I01ac1fd09edb9a10ea365c2376ccf3d6d7a9c4f1 Signed-off-by: Suyeon Hwang --- diff --git a/common/tts_config_mgr.c b/common/tts_config_mgr.c index 36a80683..f95a228c 100644 --- a/common/tts_config_mgr.c +++ b/common/tts_config_mgr.c @@ -1859,7 +1859,7 @@ int tts_config_mgr_set_voice(const char* language, int type) free(default_engine); tts_config_voice_s *voice = __get_voice_info(engine_info, language, type); - if (NULL != voice) { + if (NULL == voice) { SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] Voice(%s/%d) is not valid in current engine", language, type); return TTS_CONFIG_ERROR_OPERATION_FAILED; } diff --git a/packaging/tts.spec b/packaging/tts.spec index 3c1a6fcf..1953698c 100644 --- a/packaging/tts.spec +++ b/packaging/tts.spec @@ -199,7 +199,7 @@ mkdir -p %{TZ_SYS_GLOBALUSER_DATA}/.voice/tts/engine-info chsmack -a "User::App::Shared" %{TZ_SYS_GLOBALUSER_DATA}/.voice/tts chsmack -t %{TZ_SYS_GLOBALUSER_DATA}/.voice/tts/engine-info chsmack -a "User::App::Shared" %{TZ_SYS_GLOBALUSER_DATA}/.voice/tts/engine-info -chown -R ui_fw:users %{TZ_SYS_GLOBALUSER_DATA}/.voice +chown -R owner:users %{TZ_SYS_GLOBALUSER_DATA}/.voice %postun -p /sbin/ldconfig