From: Suyeon Hwang Date: Mon, 21 Nov 2022 10:37:27 +0000 (+0900) Subject: Assure that client always registers the callback in sync prepare X-Git-Tag: accepted/tizen/7.0/unified/20230106.165639~2^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d116d4d9e2692e2e8fce313cce21eb1744487117;p=platform%2Fcore%2Fuifw%2Ftts.git Assure that client always registers the callback in sync prepare - Issue: Sometimes, the message receive callback registration is skipped even if the connection is normal. - Solution: The client lib always checks the 'register_callback_invoked' flag, but this flag may not be set properly some cases even if client tries to prepare synchronously. Thus, this patch removes the flag checking code from synchronous prepare logic. The synchronous prepare should insure the invocation of all protocol, so through this patch, the all step of preparation will be invoked. Change-Id: If89f4065f139ec032bedddebf6a9927c74f100e7 Signed-off-by: Suyeon Hwang --- diff --git a/client/tts_tidl.c b/client/tts_tidl.c index c87914a2..36bfa0e6 100644 --- a/client/tts_tidl.c +++ b/client/tts_tidl.c @@ -138,7 +138,6 @@ static void __on_connected(rpc_port_proxy_tts_h h, void *user_data) info->connected = true; info->connection_requesting = false; - info->register_callback_invoked = false; SLOG(LOG_DEBUG, TAG_TTSC, "Connected to server"); } @@ -328,6 +327,7 @@ static int __invoke_register_callback(int pid, tts_mode_e mode, int registered_e return ret; } + SLOG(LOG_ERROR, TAG_TTSC, ">>>>> Request register cb. uid(%d)", info->uid); rpc_port_proxy_tts_invoke_register_cb(info->rpc_h, pid, info->uid, (int)mode, registered_event_mask, info->notify_cb_h); info->register_callback_invoked = true; return TTS_ERROR_NONE; @@ -403,30 +403,28 @@ static int __convert_unhandled_error(int ret) static int __invoke_register_callback_sync(int pid, tts_tidl_info_s* info) { - if (info->register_callback_invoked) { - SLOG(LOG_ERROR, TAG_TTSC, "[INFO] Already register callback is invoked"); - return TTS_ERROR_NONE; - } - int ret = TTS_ERROR_NONE; + ret = __create_notify_callback_handle(info); if (TTS_ERROR_NONE != ret) { SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Fail to create callback handle. ret(%d/%s)", ret, get_error_message(ret)); return ret; } + info->register_callback_invoked = true; + SLOG(LOG_ERROR, TAG_TTSC, ">>>>> Request register cb sync. uid(%d)", info->uid); ret = rpc_port_proxy_tts_invoke_register_cb_sync(info->rpc_h, pid, info->uid, info->notify_cb_h); int exception = get_last_result(); if (RPC_PORT_ERROR_NONE != exception) { ret = __convert_unhandled_error(exception); } + info->register_callback_invoked = false; if (TTS_ERROR_NONE != ret) { SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Fail to register callback. ret(%d/%s)", ret, get_error_message(ret)); return ret; } - info->register_callback_invoked = true; return TTS_ERROR_NONE; } @@ -480,8 +478,8 @@ int tts_tidl_request_initialize(unsigned int uid, tts_mode_e mode, int registere ret = __convert_unhandled_error(exception); } + SLOG(LOG_ERROR, TAG_TTSC, ">>>> Request tts initialize : ret(%d/%s)", ret, get_error_message(ret)); if (TTS_ERROR_NONE != ret) { - SLOG(LOG_ERROR, TAG_TTSC, ">>>> Request tts initialize : Fail to invoke message"); return ret; } @@ -504,15 +502,14 @@ int tts_tidl_request_finalize(unsigned int uid) RETVM_IF(!info->connected, TTS_ERROR_OPERATION_FAILED, "[ERROR] Not Connected"); - int ret = rpc_port_proxy_tts_invoke_finalize(info->rpc_h, uid); int exception = get_last_result(); if (RPC_PORT_ERROR_NONE != exception) { ret = __convert_unhandled_error(exception); } + SLOG(LOG_ERROR, TAG_TTSC, ">>>> Request tts finalize. ret(%d/%s)", ret, get_error_message(ret)); if (TTS_ERROR_NONE != ret) { - SLOG(LOG_ERROR, TAG_TTSC, ">>>> Request tts initialize : Fail to invoke message"); return ret; }