Connect synchronously when app uses setting API 81/286181/1
authorSuyeon Hwang <stom.hwang@samsung.com>
Tue, 15 Nov 2022 12:11:57 +0000 (21:11 +0900)
committerSuyeon Hwang <stom.hwang@samsung.com>
Fri, 30 Dec 2022 01:31:58 +0000 (10:31 +0900)
- 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 <stom.hwang@samsung.com>
client/vc_setting_tidl.c

index 33ec24a..162cd50 100644 (file)
@@ -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;
        }