From: Suyeon Hwang Date: Mon, 20 Mar 2023 10:25:44 +0000 (+0900) Subject: Remove duplicated logic int stop behavior X-Git-Tag: accepted/tizen/unified/20230424.185343~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F12%2F290312%2F2;p=platform%2Fcore%2Fuifw%2Fstt.git Remove duplicated logic int stop behavior - Issue: In __stop_by_silence() function, there is duplicated logic. - Solution: In previous code, __stop_by_silence() function send message to client according to the return value of sttd_server_stop(). However, sttd_server_stop() is already send message when it is return STATE DONE value. Thus, the bahvior on __stop_by_silence() is actually unvaluable. Thus, this patch removes that code to reduce duplicated logic. Change-Id: I61948b1ad6fe6d243b1240fb8ae484639b072e0e Signed-off-by: Suyeon Hwang --- diff --git a/server/sttd_server.c b/server/sttd_server.c index 3c4b3e8..b096694 100644 --- a/server/sttd_server.c +++ b/server/sttd_server.c @@ -60,23 +60,11 @@ Eina_Bool __stop_by_silence(void *data) unsigned int uid = stt_client_get_current_recognition(); - int ret; if (STT_INVALID_UID != uid) { - ret = sttd_server_stop(uid); - if (0 > ret) { + int ret = sttd_server_stop(uid); + if (STTD_ERROR_NONE != ret) { + SLOG(LOG_WARN, TAG_STTD, "[Server WARNING] Fail to stop recording"); __cancel_recognition_internal(); - return EINA_FALSE; - } - - if (STTD_RESULT_STATE_DONE == ret) { - ret = sttdc_send_set_state(uid, (int)APP_STATE_PROCESSING); - if (0 != ret) { - SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] Fail to send state : result(%d)", ret); - - /* Remove client */ - sttd_server_finalize(uid); - stt_client_unset_current_recognition(); - } } } else { SLOG(LOG_WARN, TAG_STTD, "[Server WARNING] uid is NOT valid");