Remove unused parameter of ttsd_server_pause() 88/271888/2
authorSuyeon Hwang <stom.hwang@samsung.com>
Fri, 14 Jan 2022 10:32:01 +0000 (19:32 +0900)
committerSuyeon Hwang <stom.hwang@samsung.com>
Tue, 15 Mar 2022 05:47:40 +0000 (14:47 +0900)
Change-Id: Id1970c88a563b86ccbbf3125cbd8b409fb876927
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
server/ttsd_dbus_server.c
server/ttsd_server.c
server/ttsd_server.h
server/ttsd_tidl.c

index 617d863..51a0ed3 100644 (file)
@@ -554,7 +554,6 @@ int ttsd_dbus_server_pause(DBusConnection* conn, DBusMessage* msg)
        dbus_error_init(&err);
 
        unsigned int uid;
-       int uttid;
        int ret = 0;
        dbus_message_get_args(msg, &err,
                DBUS_TYPE_UINT32, &uid,
@@ -568,7 +567,7 @@ int ttsd_dbus_server_pause(DBusConnection* conn, DBusMessage* msg)
                ret = TTSD_ERROR_OPERATION_FAILED;
        } else {
                SECURE_SLOG(LOG_DEBUG, tts_tag(), "[IN] tts pause : uid(%u)", uid);
-               ret = ttsd_server_pause(uid, &uttid);
+               ret = ttsd_server_pause(uid);
        }
 
        DBusMessage* reply;
index 1bd35ec..36f3165 100644 (file)
@@ -929,23 +929,6 @@ int ttsd_server_add_text(unsigned int uid, const char* text, const char* lang, i
        return TTSD_ERROR_NONE;
 }
 
-static int __pause_client(unsigned int uid)
-{
-       int ret = ttsd_data_set_client_state(uid, APP_STATE_PAUSED);
-       if (TTSD_ERROR_NONE != ret) {
-               SLOG(LOG_ERROR, tts_tag(), "[Server ERROR] Fail set pause state() : ret(%d)", ret);
-               return TTSD_ERROR_OPERATION_FAILED;
-       }
-
-       ret = ttsd_player_pause(uid);
-       if (TTSD_ERROR_NONE != ret) {
-               SLOG(LOG_ERROR, tts_tag(), "[Server ERROR] Fail player_pause() : ret(%d)", ret);
-               return TTSD_ERROR_OPERATION_FAILED;
-       }
-
-       return TTSD_ERROR_NONE;
-}
-
 void __send_interrupt_client(unsigned int uid)
 {
        SLOG(LOG_INFO, tts_tag(), "[Server] Send new state by policy. uid(%u)", uid);
@@ -1013,7 +996,7 @@ int ttsd_server_play(unsigned int uid, const char* credential)
                        SLOG(LOG_DEBUG, tts_tag(), "[Server] Old uid(%u) will be interrupted into 'Pause' state ", current_uid);
 
                        /* pause player */
-                       if (0 != __pause_client(current_uid)) {
+                       if (0 != ttsd_server_pause(current_uid)) {
                                SLOG(LOG_WARN, tts_tag(), "[Server ERROR] Fail to ttsd_server_pause() : uid (%u)", current_uid);
                        }
                }
@@ -1098,7 +1081,7 @@ int ttsd_server_stop(unsigned int uid)
        return TTSD_ERROR_NONE;
 }
 
-int ttsd_server_pause(unsigned int uid, int* utt_id)
+int ttsd_server_pause(unsigned int uid)
 {
        app_tts_state_e state = ttsd_data_get_client_state(uid);
        if (APP_STATE_NONE == state) {
@@ -1111,17 +1094,20 @@ int ttsd_server_pause(unsigned int uid, int* utt_id)
                return TTSD_ERROR_INVALID_STATE;
        }
 
-       g_is_paused = true;
-
-       *utt_id = g_utt.uttid;
-       SLOG(LOG_INFO, tts_tag(), "[Server] server pause, uid(%u), g_uid(%u), utt_id(%d)", uid, g_utt.uid, *utt_id);
+       int ret = ttsd_data_set_client_state(uid, APP_STATE_PAUSED);
+       if (TTSD_ERROR_NONE != ret) {
+               SLOG(LOG_ERROR, tts_tag(), "[Server ERROR] Fail set pause state() : ret(%d)", ret);
+               return TTSD_ERROR_OPERATION_FAILED;
+       }
 
-       int ret = __pause_client(uid);
+       ret = ttsd_player_pause(uid);
        if (TTSD_ERROR_NONE != ret) {
-               SLOG(LOG_ERROR, tts_tag(), "[Server ERROR] Fail to pause player : ret(%d)", ret);
+               SLOG(LOG_ERROR, tts_tag(), "[Server ERROR] Fail player_pause() : ret(%d)", ret);
                return TTSD_ERROR_OPERATION_FAILED;
        }
 
+       g_is_paused = true;
+
        return TTSD_ERROR_NONE;
 }
 
@@ -1267,7 +1253,7 @@ int ttsd_server_play_pcm(unsigned int uid)
                        SLOG(LOG_DEBUG, tts_tag(), "[Server] Old uid(%u) will be interrupted into 'Pause' state ", current_uid);
 
                        /* pause player */
-                       if (0 != __pause_client(current_uid)) {
+                       if (0 != ttsd_server_pause(current_uid)) {
                                SLOG(LOG_WARN, tts_tag(), "[Server ERROR] Fail to ttsd_server_pause() : uid (%u)", current_uid);
                        }
                }
index 8fe95c6..726b085 100644 (file)
@@ -67,7 +67,7 @@ int ttsd_server_play(unsigned int uid, const char* credential);
 
 int ttsd_server_stop(unsigned int uid);
 
-int ttsd_server_pause(unsigned int uid, int* utt_id);
+int ttsd_server_pause(unsigned int uid);
 
 int ttsd_server_set_private_data(unsigned int uid, const char* key, const char* data);
 
index 134cad2..00f1ba0 100644 (file)
@@ -355,11 +355,10 @@ static int __stop_cb(rpc_port_stub_tts_context_h context, int uid, void *user_da
 
 static int __pause_cb(rpc_port_stub_tts_context_h context, int uid, void *user_data)
 {
-       int uttid;
        unsigned int u_uid = (unsigned int)uid;
        SLOG(LOG_DEBUG, tts_tag(), ">>>>> TTS PLAYER PAUSE (%u)", u_uid);
 
-       int ret = ttsd_server_pause(u_uid, &uttid);
+       int ret = ttsd_server_pause(u_uid);
        if (TTSD_ERROR_NONE != ret) {
                SLOG(LOG_ERROR, tts_tag(), "[ERROR] TTS PLAYER PAUSE (%u) fail (%d/%s) <<<<<", u_uid, ret, get_error_message(ret));
                return ret;