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 36a80683ce10ffe545fad60453fa6a296e7ddde5..f95a228c8f59c79ade278e12a3801ff63c1fc00c 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 3c1a6fcff77416d9db18703b4356a7e920137e64..1953698cf89f7eaefa8f0e87b6bb1f4a90591877 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