Make function to access uid of client 07/257107/2
authorSuyeon Hwang <stom.hwang@samsung.com>
Wed, 18 Nov 2020 07:48:11 +0000 (16:48 +0900)
committerSuyeon Hwang <stom.hwang@samsung.com>
Thu, 27 May 2021 04:45:11 +0000 (13:45 +0900)
Change-Id: I79b36ab368f559aeb8f3368eca508f80f8c9aca4
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
client/tts.c
client/tts_client.c
client/tts_client.h
client/tts_core.c
client/tts_tidl.c

index 5aa2858..4824e29 100644 (file)
@@ -253,7 +253,8 @@ int tts_create(tts_h* tts)
                return TTS_ERROR_OPERATION_FAILED;
        }
 
-       SLOG(LOG_ERROR, TAG_TTSC, "[INFO] tts_h(%p), tts_client(%p), uid(%d)", tts, client, client->uid);
+       int uid = tts_client_get_uid(client);
+       SLOG(LOG_ERROR, TAG_TTSC, "[INFO] tts_h(%p), tts_client(%p), uid(%d)", tts, client, uid);
 
        if (false == tts_ipc_is_method_set()) {
                int pid = getpid();
@@ -273,19 +274,19 @@ int tts_create(tts_h* tts)
                }
        }
 
-       if (0 != tts_ipc_open_connection(client->uid)) {
+       if (0 != tts_ipc_open_connection(uid)) {
                SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Fail to open dbus connection");
                return TTS_ERROR_OPERATION_FAILED;
        }
 
-       int ret = tts_config_mgr_initialize(client->uid);
+       int ret = tts_config_mgr_initialize(uid);
        if (0 != ret) {
                SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Fail to init config manager : %d", ret);
                tts_client_destroy(*tts);
                return __tts_convert_config_error_code(ret);
        }
 
-       ret = tts_config_mgr_set_callback(client->uid, _tts_config_engine_changed_cb, __tts_config_voice_changed_cb, NULL, NULL, NULL, tts);
+       ret = tts_config_mgr_set_callback(uid, _tts_config_engine_changed_cb, __tts_config_voice_changed_cb, NULL, NULL, NULL, tts);
        if (0 != ret) {
                SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Fail to set config changed : %d", ret);
                tts_client_destroy(*tts);
@@ -319,7 +320,8 @@ int tts_destroy(tts_h tts)
                return TTS_ERROR_INVALID_PARAMETER;
        }
 
-       SLOG(LOG_ERROR, TAG_TTSC, "[INFO] tts_h(%p), tts_client(%p), uid(%d)", tts, client, client->uid);
+       int uid = tts_client_get_uid(client);
+       SLOG(LOG_ERROR, TAG_TTSC, "[INFO] tts_h(%p), tts_client(%p), uid(%d)", tts, client, uid);
 
        /* check used callback */
        if (0 != tts_client_get_use_callback(client)) {
@@ -327,7 +329,7 @@ int tts_destroy(tts_h tts)
                return TTS_ERROR_OPERATION_FAILED;
        }
 
-       tts_config_mgr_finalize(client->uid);
+       tts_config_mgr_finalize(uid);
 
        // TODO: move into tts_client
        if (client->hello_timer) {
@@ -365,7 +367,7 @@ int tts_destroy(tts_h tts)
                        thread_count = ecore_thread_active_get();
                }
 
-               if (0 != tts_ipc_close_connection(client->uid)) {
+               if (0 != tts_ipc_close_connection(uid)) {
                        SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Fail to close connection");
                        return TTS_ERROR_OPERATION_FAILED;
                }
@@ -575,7 +577,6 @@ int tts_set_server_tts(tts_h tts, const char* credential)
        key = NULL;
 
        SLOG(LOG_DEBUG, TAG_TTSC, "@@@");
-
        return TTS_ERROR_NONE;
 }
 // LCOV_EXCL_STOP
@@ -606,7 +607,6 @@ int tts_prepare(tts_h tts)
        }
 
        SLOG(LOG_DEBUG, TAG_TTSC, "@@@");
-
        return TTS_ERROR_NONE;
 }
 
@@ -637,7 +637,6 @@ int tts_prepare_sync(tts_h tts)
        }
 
        SLOG(LOG_DEBUG, TAG_TTSC, "@@@");
-
        return TTS_ERROR_NONE;
 }
 //LCOV_EXCL_STOP
@@ -668,7 +667,6 @@ int tts_unprepare(tts_h tts)
        }
 
        SLOG(LOG_DEBUG, TAG_TTSC, "@@@");
-
        return TTS_ERROR_NONE;
 }
 
@@ -959,11 +957,12 @@ int tts_add_text(tts_h tts, const char* text, const char* language, int voice_ty
        }
 
        /* do request */
+       int uid = tts_client_get_uid(client);
        int ret = -1;
        int count = 0;
        bool is_prepared = false;
        while (0 != ret) {
-               ret = tts_ipc_request_add_text(client->uid, text, temp, voice_type, speed, client->current_utt_id, client->credential);
+               ret = tts_ipc_request_add_text(uid, text, temp, voice_type, speed, client->current_utt_id, client->credential);
                if (0 != ret) {
                        //LCOV_EXCL_START
                        if (TTS_ERROR_INVALID_PARAMETER == ret && false == is_prepared) {
@@ -1011,11 +1010,12 @@ static void __tts_play_async(void *data)
                return;
        }
 
+       int uid = tts_client_get_uid(client);
        int ret = -1;
        int count = 0;
        bool is_prepared = false;
        while (0 != ret) {
-               ret = tts_ipc_request_play(client->uid, client->credential);
+               ret = tts_ipc_request_play(uid, client->credential);
                if (0 != ret) {
                        if (TTS_ERROR_INVALID_PARAMETER == ret && false == is_prepared) {
                                tts_client_set_current_state(client, TTS_STATE_CREATED);
@@ -1120,11 +1120,12 @@ int tts_play(tts_h tts)
                return TTS_ERROR_PERMISSION_DENIED;
        }
 
+       int uid = tts_client_get_uid(client);
        ret = -1;
        int count = 0;
        bool is_prepared = false;
        while (0 != ret) {
-               ret = tts_ipc_request_play(client->uid, client->credential);
+               ret = tts_ipc_request_play(uid, client->credential);
                if (0 != ret) {
                        //LCOV_EXCL_START
                        if (TTS_ERROR_INVALID_PARAMETER == ret && false == is_prepared) {
@@ -1166,11 +1167,12 @@ static void __tts_stop_async(void *data)
                return;
        }
 
+       int uid = tts_client_get_uid(client);
        int ret = -1;
        int count = 0;
        bool is_prepared = false;
        while (0 != ret) {
-               ret = tts_ipc_request_stop(client->uid);
+               ret = tts_ipc_request_stop(uid);
                if (0 != ret) {
                        if (TTS_ERROR_INVALID_PARAMETER == ret && false == is_prepared) {
                                tts_client_set_current_state(client, TTS_STATE_CREATED);
@@ -1263,11 +1265,12 @@ int tts_stop(tts_h tts)
                return TTS_ERROR_INVALID_STATE;
        }
 
+       int uid = tts_client_get_uid(client);
        int ret = -1;
        int count = 0;
        bool is_prepared = false;
        while (0 != ret) {
-               ret = tts_ipc_request_stop(client->uid);
+               ret = tts_ipc_request_stop(uid);
                if (0 != ret) {
                        //LCOV_EXCL_START
                        if (TTS_ERROR_INVALID_PARAMETER == ret && false == is_prepared) {
@@ -1308,11 +1311,12 @@ static void __tts_pause_async(void *data)
                return;
        }
 
+       int uid = tts_client_get_uid(client);
        int ret = -1;
        int count = 0;
        bool is_prepared = false;
        while (0 != ret) {
-               ret = tts_ipc_request_pause(client->uid);
+               ret = tts_ipc_request_pause(uid);
                if (0 != ret) {
                        if (TTS_ERROR_INVALID_PARAMETER == ret && false == is_prepared) {
                                tts_client_set_current_state(client, TTS_STATE_CREATED);
@@ -1404,11 +1408,12 @@ int tts_pause(tts_h tts)
                return TTS_ERROR_INVALID_STATE;
        }
 
+       int uid = tts_client_get_uid(client);
        int ret = -1;
        int count = 0;
        bool is_prepared = false;
        while (0 != ret) {
-               ret = tts_ipc_request_pause(client->uid);
+               ret = tts_ipc_request_pause(uid);
                if (0 != ret) {
                        //LCOV_EXCL_START
                        if (TTS_ERROR_INVALID_PARAMETER == ret && false == is_prepared) {
@@ -1469,11 +1474,12 @@ int tts_set_private_data(tts_h tts, const char* key, const char* data)
                return TTS_ERROR_INVALID_PARAMETER;
        }
 
+       int uid = tts_client_get_uid(client);
        int ret = -1;
        int count = 0;
        bool is_prepared = false;
        while (0 != ret) {
-               ret = tts_ipc_request_set_private_data(client->uid, key, data);
+               ret = tts_ipc_request_set_private_data(uid, key, data);
                if (0 != ret) {
                        //LCOV_EXCL_START
                        if (TTS_ERROR_INVALID_PARAMETER == ret && false == is_prepared) {
@@ -1528,11 +1534,12 @@ int tts_get_private_data(tts_h tts, const char* key, char** data)
                return TTS_ERROR_INVALID_STATE;
        }
 
+       int uid = tts_client_get_uid(client);
        int ret = -1;
        int count = 0;
        bool is_prepared = false;
        while (0 != ret) {
-               ret = tts_ipc_request_get_private_data(client->uid, key, data);
+               ret = tts_ipc_request_get_private_data(uid, key, data);
                if (0 != ret) {
                        //LCOV_EXCL_START
                        if (TTS_ERROR_INVALID_PARAMETER == ret && false == is_prepared) {
@@ -1923,11 +1930,12 @@ int tts_add_pcm(tts_h tts, int event, const void* data, unsigned int data_size,
                return TTS_ERROR_INVALID_STATE;
        }
 
+       int uid = tts_client_get_uid(client);
        int ret = -1;
        int count = 0;
        bool is_prepared = false;
        while (0 != ret) {
-               ret = tts_ipc_request_add_pcm(client->uid, event, data, data_size, audio_type, rate);
+               ret = tts_ipc_request_add_pcm(uid, event, data, data_size, audio_type, rate);
                if (0 != ret) {
                        if (TTS_ERROR_INVALID_PARAMETER == ret && false == is_prepared) {
                                tts_client_set_current_state(client, TTS_STATE_CREATED);
@@ -1980,11 +1988,12 @@ int tts_play_pcm(tts_h tts)
                return TTS_ERROR_INVALID_STATE;
        }
 
+       int uid = tts_client_get_uid(client);
        int ret = -1;
        int count = 0;
        bool is_prepared = false;
        while (0 != ret) {
-               ret = tts_ipc_request_play_pcm(client->uid);
+               ret = tts_ipc_request_play_pcm(uid);
                if (0 != ret) {
                        if (TTS_ERROR_INVALID_PARAMETER == ret && false == is_prepared) {
                                tts_client_set_current_state(client, TTS_STATE_CREATED);
@@ -2038,11 +2047,12 @@ int tts_stop_pcm(tts_h tts)
                return TTS_ERROR_INVALID_STATE;
        }
 
+       int uid = tts_client_get_uid(client);
        int ret = -1;
        int count = 0;
        bool is_prepared = false;
        while (0 != ret) {
-               ret = tts_ipc_request_stop_pcm(client->uid);
+               ret = tts_ipc_request_stop_pcm(uid);
                if (0 != ret) {
                        if (TTS_ERROR_INVALID_PARAMETER == ret && false == is_prepared) {
                                tts_client_set_current_state(client, TTS_STATE_CREATED);
index cdc2935..241c756 100644 (file)
@@ -378,6 +378,16 @@ GList* tts_client_get_client_list()
 }
 //LCOV_EXCL_STOP
 
+int tts_client_get_uid(tts_client_s* client)
+{
+       if (NULL == client || false == tts_client_is_valid_client(client)) {
+               SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Client(%p) is not valid", client);
+               return INVALID_HANDLE;
+       }
+
+       return client->uid;
+}
+
 void tts_client_set_current_state(tts_client_s* client, tts_state_e state)
 {
        if (false == tts_client_is_valid_client(client)) {
index 705c76c..e0c54ba 100644 (file)
@@ -106,6 +106,8 @@ int tts_client_get_mode_client_count(tts_mode_e mode);
 
 GList* tts_client_get_client_list();
 
+int tts_client_get_uid(tts_client_s* client);
+
 void tts_client_set_current_state(tts_client_s* client, tts_state_e state);
 tts_state_e tts_client_get_current_state(tts_client_s* client);
 
index 055c517..3713e1c 100644 (file)
@@ -444,7 +444,8 @@ static int __send_hello_msg(tts_client_s* client)
                return TTS_ERROR_INVALID_STATE;
        }
 
-       SLOG(LOG_INFO, TAG_TTSC, "[INFO] tts_h(%p), tts_client(%p), uid(%d)", tts_client_get_handle(client), client, client->uid);
+       int uid = tts_client_get_uid(client);
+       SLOG(LOG_INFO, TAG_TTSC, "[INFO] tts_h(%p), tts_client(%p), uid(%d)", tts_client_get_handle(client), client, uid);
 
        /* check service engine status */
        bool is_launched = __is_engine_launched(tts_client_get_mode(client));
@@ -460,7 +461,7 @@ static int __send_hello_msg(tts_client_s* client)
        }
 
        /* Send hello */
-       int ret = tts_ipc_request_hello(client->uid);
+       int ret = tts_ipc_request_hello(uid);
        if (0 != ret) {
                SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Fail to request hello !!"); //LCOV_EXCL_LINE
        } else {
@@ -540,9 +541,8 @@ static Eina_Bool __prepare_sync_cb(tts_client_s* client)
                }
        }
        // TODO: make function duplicated block
-
-       /* Send hello */
-       if (0 != tts_ipc_request_hello_sync(client->uid)) {
+       int uid = tts_client_get_uid(client);
+       if (0 != tts_ipc_request_hello_sync(uid)) {
                return EINA_TRUE;
        }
 
@@ -553,8 +553,7 @@ static Eina_Bool __prepare_sync_cb(tts_client_s* client)
        int ret = -1;
        bool credential_needed = false;
 
-       ret = tts_ipc_request_initialize(client->uid, &credential_needed);
-
+       ret = tts_ipc_request_initialize(uid, &credential_needed);
        if (TTS_ERROR_ENGINE_NOT_FOUND == ret || TTS_ERROR_PERMISSION_DENIED == ret) {
                SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Fail to initialize : %s", __tts_get_error_code(ret));
                tts_core_notify_error_async(client, ret, -1, NULL);
@@ -701,7 +700,7 @@ int tts_core_notify_state_changed_async(tts_client_s* client, tts_state_e before
        if (NULL != client->notify_state_timer) {
                ecore_timer_del(client->notify_state_timer);
        }
-       client->notify_state_timer = ecore_timer_add(0, __notify_state_timer_cb, (void*)client->uid);
+       client->notify_state_timer = ecore_timer_add(0, __notify_state_timer_cb, (void*)tts_client_get_uid(client));
 
        return TTS_ERROR_NONE;
 }
@@ -770,7 +769,7 @@ int tts_core_notify_error_async(tts_client_s* client, tts_error_e reason, int ut
        if (NULL != client->notify_error_timer) {
                ecore_timer_del(client->notify_error_timer);
        }
-       client->notify_error_timer = ecore_timer_add(0, __notify_error_timer_cb, (void*)client->uid);
+       client->notify_error_timer = ecore_timer_add(0, __notify_error_timer_cb, (void*)tts_client_get_uid(client));
 
        return TTS_ERROR_NONE;
 }
@@ -847,7 +846,7 @@ int tts_core_set_mode(tts_client_s* client, tts_mode_e mode)
                return TTS_ERROR_INVALID_PARAMETER;
        }
 
-       int uid = client->uid;
+       int uid = tts_client_get_uid(client);
        tts_client_set_mode(client, mode);
        if (TTS_MODE_SCREEN_READER == mode) {
                if (0 != __update_screen_reader_state()) {
@@ -982,12 +981,12 @@ int tts_core_prepare(tts_client_s* client)
                return TTS_ERROR_INVALID_PARAMETER;
        }
 
-       SLOG(LOG_INFO, TAG_TTSC, "[INFO] tts_h(%p), tts_client(%p), uid(%d)", tts_client_get_handle(client), client, client->uid);
+       SLOG(LOG_INFO, TAG_TTSC, "[INFO] Start core_prepare. tts_h(%p), tts_client(%p)", tts_client_get_handle(client), client);
        if (NULL == client->hello_timer) {
                SLOG(LOG_ERROR, TAG_TTSC, "Register timer for __prepare_first_cb");
 
                ecore_thread_main_loop_begin();
-               client->hello_timer = ecore_timer_add(0.0, __prepare_first_cb, (void*)client->uid);
+               client->hello_timer = ecore_timer_add(0.0, __prepare_first_cb, (void*)tts_client_get_uid(client));
                ecore_thread_main_loop_end();
        } else {
                LOGD("Client is already trying to prepare");
@@ -1003,19 +1002,18 @@ int tts_core_prepare_sync(tts_client_s* client)
                return TTS_ERROR_INVALID_PARAMETER;
        }
 
-       SLOG(LOG_INFO, TAG_TTSC, "[INFO] tts_h(%p), tts_client(%p), uid(%d)", tts_client_get_handle(client), client, client->uid);
+       SLOG(LOG_INFO, TAG_TTSC, "[INFO] Start core_prepare_sync. tts_h(%p), tts_client(%p), uid(%d)", tts_client_get_handle(client), client, tts_client_get_uid(client));
        int cnt = 0;
        while (EINA_TRUE == __prepare_sync_cb(client) && TTS_CONNECTION_RETRY_COUNT > cnt) {
                cnt++;
        }
 
-       SLOG(LOG_DEBUG, TAG_TTSC, "@@@");
-
        if (TTS_CONNECTION_RETRY_COUNT == cnt) {
                SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Fail to connect daemon");
                return TTS_ERROR_OPERATION_FAILED;
        }
 
+       SLOG(LOG_DEBUG, TAG_TTSC, "@@@");
        return TTS_ERROR_NONE;
 }
 
@@ -1026,7 +1024,8 @@ int tts_core_unprepare(tts_client_s* client)
                return TTS_ERROR_INVALID_PARAMETER;
        }
 
-       SLOG(LOG_INFO, TAG_TTSC, "[INFO] tts_h(%p), tts_client(%p), uid(%d)", tts_client_get_handle(client), client, client->uid);
+       int uid = tts_client_get_uid(client);
+       SLOG(LOG_INFO, TAG_TTSC, "[INFO] tts_h(%p), tts_client(%p), uid(%d)", tts_client_get_handle(client), client, uid);
        if (client->hello_timer) {
                ecore_timer_del(client->hello_timer);
                client->hello_timer = NULL;
@@ -1041,7 +1040,7 @@ int tts_core_unprepare(tts_client_s* client)
        if (false == g_is_screen_reader_on && TTS_MODE_SCREEN_READER == mode) {
                SLOG(LOG_WARN, TAG_TTSC, "[WARNING] Do not request finalize : is_screen_reader(%d) mode(%d)", g_is_screen_reader_on, mode);
 
-               ret = tts_ipc_stop_listening(client->uid);
+               ret = tts_ipc_stop_listening(uid);
                if (0 != ret) {
                        SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Fail to remove match : %s", __tts_get_error_code(ret));
                }
@@ -1049,7 +1048,7 @@ int tts_core_unprepare(tts_client_s* client)
                bool is_prepared = false;
 
                do {
-                       ret = tts_ipc_request_finalize(client->uid);
+                       ret = tts_ipc_request_finalize(uid);
                        if (0 != ret) {
                                //LCOV_EXCL_START
                                if (TTS_ERROR_INVALID_PARAMETER == ret && false == is_prepared) {
@@ -1111,8 +1110,13 @@ int tts_core_reprepare()
 
 int tts_core_foreach_supported_voices(tts_client_s* client, const char* engine_id, tts_supported_voice_cb callback, void* user_data)
 {
+       if (false == tts_client_is_valid_client(client)) {
+               SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] client is not valid");
+               return TTS_ERROR_INVALID_PARAMETER;
+       }
+
        tts_client_set_supported_voice_cb(client, callback, user_data);
-       int ret = tts_config_mgr_get_voice_list(engine_id, __supported_voice_cb, (void*)client->uid);
+       int ret = tts_config_mgr_get_voice_list(engine_id, __supported_voice_cb, (void*)tts_client_get_uid(client));
        tts_client_set_supported_voice_cb(client, NULL, NULL);
 
        if (0 != ret) {
index f5117c2..e20f327 100644 (file)
@@ -78,7 +78,7 @@ static void __reconnect(void *data)
                return;
 
        for (int nsec = 1; nsec <= MAXSLEEP; nsec <<= 1) {
-               if (0 == tts_tidl_open_connection(client->uid)) {
+               if (0 == tts_tidl_open_connection(uid)) {
                        SLOG(LOG_DEBUG, TAG_TTSC, "Try to connect the service");
                        return;
                }
@@ -334,7 +334,7 @@ int tts_tidl_request_hello(int uid)
        SLOG(LOG_DEBUG, TAG_TTSC, ">>>>> TTS Hello");
        /* register callback - needed to create new client before adding callback */
        rpc_port_tts_notify_cb_h cb = rpc_port_tts_notify_cb_create(__notify_cb, false, NULL);
-       if (0 != rpc_port_proxy_tts_invoke_register_cb(tts->rpc_h, client->pid, client->uid, cb)) {
+       if (0 != rpc_port_proxy_tts_invoke_register_cb(tts->rpc_h, client->pid, uid, cb)) {
                SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Failed to invoke register");
                return TTS_ERROR_OPERATION_FAILED;
        }
@@ -372,7 +372,7 @@ int tts_tidl_request_initialize(int uid, bool* credential_needed)
                return TTS_ERROR_OPERATION_FAILED;
        }
 
-       if (0 != rpc_port_proxy_tts_invoke_initialize(tts->rpc_h, client->pid, client->uid, &temp)) {
+       if (0 != rpc_port_proxy_tts_invoke_initialize(tts->rpc_h, client->pid, uid, &temp)) {
                SLOG(LOG_ERROR, TAG_TTSC, ">>>> Request tts initialize : Fail to invoke message");
                return TTS_ERROR_OPERATION_FAILED;
        }
@@ -405,7 +405,7 @@ int tts_tidl_request_finalize(int uid)
                return TTS_ERROR_OPERATION_FAILED;
        }
 
-       if (0 != rpc_port_proxy_tts_invoke_finalize(tts->rpc_h, client->uid)) {
+       if (0 != rpc_port_proxy_tts_invoke_finalize(tts->rpc_h, uid)) {
                SLOG(LOG_ERROR, TAG_TTSC, ">>>> Request tts initialize : Fail to invoke message");
                return TTS_ERROR_OPERATION_FAILED;
        }
@@ -440,7 +440,7 @@ int tts_tidl_request_add_text(int uid, const char* text, const char* lang, int v
                return TTS_ERROR_OPERATION_FAILED;
        }
 
-       if (0 != rpc_port_proxy_tts_invoke_add_text(tts->rpc_h, client->uid, text, lang, vctype, speed, uttid, credential)) {
+       if (0 != rpc_port_proxy_tts_invoke_add_text(tts->rpc_h, uid, text, lang, vctype, speed, uttid, credential)) {
                SLOG(LOG_ERROR, TAG_TTSC, ">>>> Request add text : Fail to invoke message");
                return TTS_ERROR_OPERATION_FAILED;
        }
@@ -474,7 +474,7 @@ int tts_tidl_request_set_private_data(int uid, const char* key, const char* data
                return TTS_ERROR_OPERATION_FAILED;
        }
 
-       if (0 != rpc_port_proxy_tts_invoke_set_private(tts->rpc_h, client->uid, key, data)) {
+       if (0 != rpc_port_proxy_tts_invoke_set_private(tts->rpc_h, uid, key, data)) {
                SLOG(LOG_ERROR, TAG_TTSC, ">>>> Request set private data : Fail to invoke message");
                return TTS_ERROR_OPERATION_FAILED;
        }
@@ -510,7 +510,7 @@ int tts_tidl_request_get_private_data(int uid, const char* key, char** data)
                return TTS_ERROR_OPERATION_FAILED;
        }
 
-       if (0 != rpc_port_proxy_tts_invoke_get_private(tts->rpc_h, client->uid, key, &tmp)) {
+       if (0 != rpc_port_proxy_tts_invoke_get_private(tts->rpc_h, uid, key, &tmp)) {
                SLOG(LOG_ERROR, TAG_TTSC, ">>>> Request get private data : Fail to invoke message");
                return TTS_ERROR_OPERATION_FAILED;
        }
@@ -542,7 +542,7 @@ int tts_tidl_request_play(int uid, const char* credential)
                return TTS_ERROR_OPERATION_FAILED;
        }
 
-       if (0 != rpc_port_proxy_tts_invoke_play(tts->rpc_h, client->uid, credential)) {
+       if (0 != rpc_port_proxy_tts_invoke_play(tts->rpc_h, uid, credential)) {
                SLOG(LOG_ERROR, TAG_TTSC, ">>>> Request play : Fail to invoke message");
                return TTS_ERROR_OPERATION_FAILED;
        }
@@ -573,7 +573,7 @@ int tts_tidl_request_stop(int uid)
                return TTS_ERROR_OPERATION_FAILED;
        }
 
-       if (0 != rpc_port_proxy_tts_invoke_stop(tts->rpc_h, client->uid)) {
+       if (0 != rpc_port_proxy_tts_invoke_stop(tts->rpc_h, uid)) {
                SLOG(LOG_ERROR, TAG_TTSC, ">>>> Request stop : Fail to invoke message");
                return TTS_ERROR_OPERATION_FAILED;
        }
@@ -603,7 +603,7 @@ int tts_tidl_request_pause(int uid)
                return TTS_ERROR_OPERATION_FAILED;
        }
 
-       if (0 != rpc_port_proxy_tts_invoke_pause(tts->rpc_h, client->uid)) {
+       if (0 != rpc_port_proxy_tts_invoke_pause(tts->rpc_h, uid)) {
                SLOG(LOG_ERROR, TAG_TTSC, ">>>> Request pause : Fail to invoke message");
                return TTS_ERROR_OPERATION_FAILED;
        }
@@ -635,7 +635,7 @@ int tts_tidl_request_play_pcm(int uid)
                return TTS_ERROR_OPERATION_FAILED;
        }
 
-       if (0 != rpc_port_proxy_tts_invoke_play_pcm(tts->rpc_h, client->uid)) {
+       if (0 != rpc_port_proxy_tts_invoke_play_pcm(tts->rpc_h, uid)) {
                SLOG(LOG_ERROR, TAG_TTSC, ">>>> Request play pcm : Fail to invoke message");
                return TTS_ERROR_OPERATION_FAILED;
        }
@@ -666,7 +666,7 @@ int tts_tidl_request_stop_pcm(int uid)
                return TTS_ERROR_OPERATION_FAILED;
        }
 
-       if (0 != rpc_port_proxy_tts_invoke_stop_pcm(tts->rpc_h, client->uid)) {
+       if (0 != rpc_port_proxy_tts_invoke_stop_pcm(tts->rpc_h, uid)) {
                SLOG(LOG_ERROR, TAG_TTSC, ">>>> Request pause pcm : Fail to invoke message");
                return TTS_ERROR_OPERATION_FAILED;
        }
@@ -697,7 +697,7 @@ int tts_tidl_request_add_pcm(int uid, int event, const char* data, int data_size
                return TTS_ERROR_OPERATION_FAILED;
        }
 
-       if (0 != rpc_port_proxy_tts_invoke_add_pcm(tts->rpc_h, client->uid, event, data, data_size, audio_type, rate)) {
+       if (0 != rpc_port_proxy_tts_invoke_add_pcm(tts->rpc_h, uid, event, data, data_size, audio_type, rate)) {
                SLOG(LOG_ERROR, TAG_TTSC, ">>>> Request pause pcm : Fail to invoke message");
                return TTS_ERROR_OPERATION_FAILED;
        }