Fix pointer checking condition and owner of config file 60/291660/2
authorSuyeon Hwang <stom.hwang@samsung.com>
Thu, 20 Apr 2023 02:29:09 +0000 (11:29 +0900)
committerSuyeon Hwang <stom.hwang@samsung.com>
Thu, 20 Apr 2023 05:21:24 +0000 (14:21 +0900)
- 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 <stom.hwang@samsung.com>
common/tts_config_mgr.c
packaging/tts.spec

index 36a8068..f95a228 100644 (file)
@@ -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;
        }
index 3c1a6fc..1953698 100644 (file)
@@ -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