Add handle type value when initialize config 30/267830/1
authorSuyeon Hwang <stom.hwang@samsung.com>
Fri, 10 Dec 2021 07:50:10 +0000 (16:50 +0900)
committerSuyeon Hwang <stom.hwang@samsung.com>
Fri, 10 Dec 2021 07:50:13 +0000 (16:50 +0900)
When client initialize the vc_config_mgr, manager and setting client send the handle with unique
type value as a parameter into. This is because the uid can be used to check the type of client
when vc_config_mgr needs to identify the client. However, widget client did not add unique value
into the handle.

Thus, this patch makes the widget client send handle with unique value for widget client. By this
change, widget client also works same as other types of client.

Change-Id: I3eb28c8a97621dd9809447bd63a79858f7353ef8
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
client/vc_widget.c

index e5e7be4a82641616d641518993ad57e8e307cc37..92e0951c29e80929092cf3150ebb3b5821cedcac 100644 (file)
@@ -188,7 +188,7 @@ int vc_widget_initialize(vc_h* vc_w)
        }
 
        /* TODO - each handle? */
-       int ret = vc_config_mgr_initialize((*vc_w)->handle);
+       int ret = vc_config_mgr_initialize((*vc_w)->handle + VC_WIDGET_CONFIG_HANDLE);
        if (0 != ret) {
                SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Fail to init config manager : %s",
                         __vc_widget_get_error_code(__vc_widget_convert_config_error_code(ret)));
@@ -197,10 +197,10 @@ int vc_widget_initialize(vc_h* vc_w)
                return __vc_widget_convert_config_error_code(ret);
        }
 
-       ret = vc_config_mgr_set_lang_cb((*vc_w)->handle, __vc_widget_lang_changed_cb);
+       ret = vc_config_mgr_set_lang_cb((*vc_w)->handle + VC_WIDGET_CONFIG_HANDLE, __vc_widget_lang_changed_cb);
        if (0 != ret) {
                SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Fail to set config changed : %d", ret);
-               vc_config_mgr_finalize((*vc_w)->handle);
+               vc_config_mgr_finalize((*vc_w)->handle + VC_WIDGET_CONFIG_HANDLE);
                vc_widget_client_destroy((*vc_w));
                pthread_mutex_unlock(&g_w_init_mutex);
                return __vc_widget_convert_config_error_code(ret);
@@ -313,8 +313,8 @@ int vc_widget_deinitialize(vc_h vc_w)
                        widget->conn_timer = NULL;
                }
 
-               vc_config_mgr_unset_lang_cb(vc_w->handle);
-               vc_config_mgr_finalize(vc_w->handle);
+               vc_config_mgr_unset_lang_cb(vc_w->handle + VC_WIDGET_CONFIG_HANDLE);
+               vc_config_mgr_finalize(vc_w->handle + VC_WIDGET_CONFIG_HANDLE);
 
                /* Free resources */
                vc_widget_client_destroy(vc_w);