From 080f8e71d2ebe58acdab57d23bc2f2a8991acbee Mon Sep 17 00:00:00 2001 From: Suyeon Hwang Date: Tue, 15 Nov 2022 21:11:57 +0900 Subject: [PATCH] Connect synchronously when app uses setting API - Issue: The setting API did not connect to vc server. - Solution: When setting API is invoked, the setting library invokes request hello function only once. However, the request hello function uses asynchronous connect and setting library did not waiting it. Thus, setting API always fails to connect to vc server. This patch changes connection function to synchronous one. Through this patch, setting API can connect vc server properly. Change-Id: I961dd545d2e92f0a4d644742e8b747086bd00e75 Signed-off-by: Suyeon Hwang --- client/vc_setting_tidl.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/client/vc_setting_tidl.c b/client/vc_setting_tidl.c index 33ec24a..162cd50 100644 --- a/client/vc_setting_tidl.c +++ b/client/vc_setting_tidl.c @@ -149,7 +149,7 @@ static void __request_tidl_connect(vc_setting_tidl_info_s* info) return; } - int ret = rpc_port_proxy_vc_setting_proxy_vc_setting_connect(info->rpc_h); + int ret = rpc_port_proxy_vc_setting_proxy_vc_setting_connect_sync(info->rpc_h); if (0 != ret) { SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to request connection to stub. ret(%d)", ret); return; @@ -272,9 +272,10 @@ int vc_setting_tidl_request_hello() vc_setting_tidl_info_s* info = __get_tidl_info_s(pid); RETVM_IF(NULL == info, VC_ERROR_INVALID_PARAMETER, TAG_VCC, "[ERROR] Fail to get tidl info"); + __request_tidl_connect(info); + if (!info->connected) { - SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Not Connected. Call __request_tidl_connect()"); - __request_tidl_connect(info); + SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Not Connected."); return VC_ERROR_OPERATION_FAILED; } -- 2.7.4