2 * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
21 #include "vc_widget_client.h"
22 #include "vc_widget_tidl.h"
23 #include "vc_widget_proxy.h"
24 #include "vc_widget_stub.h"
28 bool connection_requesting;
29 bool register_callback_invoked;
30 rpc_port_proxy_vc_widget_h rpc_h;
31 rpc_port_proxy_vc_widget_notify_cb_h notify_cb_h;
32 } vc_widget_tidl_info_s;
36 bool register_callback_requesting;
37 } vcd_widget_tidl_info_s;
39 static vc_widget_tidl_info_s* g_proxy_tidl_info = NULL;
41 static vcd_widget_tidl_info_s* g_stub_tidl_info = NULL;
43 static pthread_mutex_t g_w_tidl_mutex = PTHREAD_MUTEX_INITIALIZER;
44 static pthread_mutex_t g_w_init_mutex = PTHREAD_MUTEX_INITIALIZER;
46 static rpc_port_stub_vcd_widget_callback_s g_widget_callback;
48 extern int __vc_widget_cb_error(int reason, int daemon_pid, char* msg);
50 extern void __vc_widget_cb_show_tooltip(int pid, bool show);
52 extern void __vc_widget_cb_result();
54 extern bool __vc_widget_cb_asr_result(int event, const char* asr_result);
56 extern int __vc_widget_cb_service_state(int state);
58 static void __notify_cb(void *user_data, bundle *msg)
62 SLOG(LOG_DEBUG, TAG_VCW, "__notify_cb is invoked");
64 bundle_get_str(msg, VC_WIDGET_BUNDLE_METHOD, &method);
66 if (0 == strncmp(VCD_WIDGET_METHOD_HELLO, method, strlen(VCD_WIDGET_METHOD_HELLO))) {
67 SLOG(LOG_INFO, TAG_VCW, "@@@ Get widget hello");
68 bundle_get_str(msg, VC_WIDGET_BUNDLE_MESSAGE, &val);
70 SLOG(LOG_DEBUG, TAG_VCW, "@@ vc widget get hello : pid(%d) ", atoi(val));
72 SLOG(LOG_ERROR, TAG_VCW, "@@ vc widget get hello : invalid pid ");
74 SLOG(LOG_DEBUG, TAG_VCW, "@@@");
75 } /* VCD_METHOD_HELLO */
77 else if (0 == strncmp(VCD_WIDGET_METHOD_SET_SERVICE_STATE, method, strlen(VCD_WIDGET_METHOD_SET_SERVICE_STATE))) {
78 bundle_get_str(msg, VC_WIDGET_BUNDLE_MESSAGE, &val);
82 SLOG(LOG_INFO, TAG_VCW, "@@ service state changed : %d", state);
83 __vc_widget_cb_service_state(state);
85 } /* VCD_WIDGET_METHOD_SET_SERVICE_STATE */
87 else if (0 == strncmp(VCD_WIDGET_METHOD_SHOW_TOOLTIP, method, strlen(VCD_WIDGET_METHOD_SHOW_TOOLTIP))) {
88 SLOG(LOG_DEBUG, TAG_VCW, "@@@ Show / Hide tooltip");
89 char* temp_show = NULL;
90 bundle_get_str(msg, VC_WIDGET_BUNDLE_MESSAGE, &val);
91 bundle_get_str(msg, VC_WIDGET_BUNDLE_SHOW, &temp_show);
99 show = atoi(temp_show);
103 SLOG(LOG_DEBUG, TAG_VCW, "@@ vc widget show tooltip : pid(%d), show(%d)", pid, show);
104 __vc_widget_cb_show_tooltip(pid, (bool)show);
106 SLOG(LOG_ERROR, TAG_VCW, "@@ vc widget show tooltip : invalid pid");
108 SLOG(LOG_DEBUG, TAG_VCW, "@@@");
109 } /* VCD_WIDGET_METHOD_SHOW_TOOLTIP */
111 else if (0 == strncmp(VCD_WIDGET_METHOD_RESULT, method, strlen(VCD_WIDGET_METHOD_RESULT))) {
112 SLOG(LOG_DEBUG, TAG_VCW, "@@@ Get widget result");
114 __vc_widget_cb_result();
116 SLOG(LOG_DEBUG, TAG_VCW, "@@@");
117 } /* VCD_WIDGET_METHOD_RESULT */
119 else if (0 == strncmp(VCD_WIDGET_METHOD_ERROR, method, strlen(VCD_WIDGET_METHOD_ERROR))) {
120 SLOG(LOG_INFO, TAG_VCW, "@@@ Get Pre Result");
121 char* temp_reason = NULL;
122 char* temp_daemon_pid = NULL;
123 char* err_msg = NULL;
125 bundle_get_str(msg, VC_WIDGET_BUNDLE_REASON, &temp_reason);
126 bundle_get_str(msg, VC_WIDGET_BUNDLE_DAEMON_PID, &temp_daemon_pid);
127 bundle_get_str(msg, VC_WIDGET_BUNDLE_ERROR_MESSAGE, &err_msg);
131 if (NULL != temp_reason) {
132 reason = atoi(temp_reason);
134 if (NULL != temp_daemon_pid) {
135 daemon_pid = atoi(temp_daemon_pid);
138 SLOG(LOG_DEBUG, TAG_VCW, "@@ vc widget get error message : reason(%d), daemon_pid(%d), msg(%s)", reason, daemon_pid, err_msg);
139 __vc_widget_cb_error(reason, daemon_pid, err_msg);
141 SLOG(LOG_DEBUG, TAG_VCW, "@@@");
142 } /* VCD_WIDGET_METHOD_ERROR */
145 SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Invalid msg");
149 static void __on_connected(rpc_port_proxy_vc_widget_h h, void *user_data)
151 g_proxy_tidl_info->connected = true;
152 g_proxy_tidl_info->connection_requesting = false;
153 g_proxy_tidl_info->register_callback_invoked = false;
155 SLOG(LOG_INFO, TAG_VCW, "Connected to server");
158 static void __on_disconnected(rpc_port_proxy_vc_widget_h h, void *user_data)
160 g_proxy_tidl_info->connected = false;
161 g_proxy_tidl_info->connection_requesting = false;
162 g_proxy_tidl_info->register_callback_invoked = false;
164 SLOG(LOG_INFO, TAG_VCW, "Disonnected to server");
167 static void __on_rejected(rpc_port_proxy_vc_widget_h h, void *user_data)
169 g_proxy_tidl_info->connection_requesting = false;
170 g_proxy_tidl_info->register_callback_invoked = false;
172 SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Rejected from server");
176 static rpc_port_proxy_vc_widget_h __create_rpc_port(const char* engine_app_id)
178 SLOG(LOG_DEBUG, TAG_VCW, "[TIDL] __create_rpc_port");
179 rpc_port_proxy_vc_widget_callback_s rpc_callback = {
180 .connected = __on_connected,
181 .disconnected = __on_disconnected,
182 .rejected = __on_rejected
185 rpc_port_proxy_vc_widget_h handle = NULL;
186 if (0 != rpc_port_proxy_vc_widget_create(engine_app_id, &rpc_callback, NULL, &handle)) {
187 SLOG(LOG_ERROR, TAG_VCW, "[TIDL ERROR] Fail to create proxy");
194 static void __vcd_widget_create_cb(rpc_port_stub_vcd_widget_context_h context, void *user_data)
196 g_stub_tidl_info->connected = true;
197 g_stub_tidl_info->register_callback_requesting = false;
199 SLOG(LOG_DEBUG, TAG_VCW, "Connected to server");
203 rpc_port_stub_vcd_widget_context_get_sender(context, &sender);
205 SLOG(LOG_ERROR, TAG_VCW, "@@@ Sender is NULL");
209 SLOG(LOG_DEBUG, TAG_VCW, "@@@ Server connect. appid(%s)", sender);
213 static void __vcd_widget_terminate_cb(rpc_port_stub_vcd_widget_context_h context, void *user_data)
215 g_stub_tidl_info->connected = false;
216 g_stub_tidl_info->register_callback_requesting = false;
218 rpc_port_stub_vcd_widget_context_set_tag(context, NULL);
221 rpc_port_stub_vcd_widget_context_get_sender(context, &sender);
225 SLOG(LOG_INFO, TAG_VCW, "@@@ Server disconnect. appid(%s)", sender);
229 static int __vcd_widget_asr_result_cb(rpc_port_stub_vcd_widget_context_h context, int pid, int event, const char *asr_result, bool *is_consumed, void *user_data)
231 SLOG(LOG_DEBUG, TAG_VCW, "@@@ Get widget asr result");
234 result = __vc_widget_cb_asr_result(event, asr_result);
235 *is_consumed = result;
237 return VC_ERROR_NONE;
240 static void __register_stub_callback()
242 if (g_stub_tidl_info->register_callback_requesting) {
246 SLOG(LOG_DEBUG, TAG_VCW, "[TIDL] __register_stub_callback");
248 g_widget_callback.create = __vcd_widget_create_cb;
249 g_widget_callback.terminate = __vcd_widget_terminate_cb;
250 g_widget_callback.send_asr_result = __vcd_widget_asr_result_cb;
253 ret = rpc_port_stub_vcd_widget_register(&g_widget_callback, NULL);
255 SLOG(LOG_DEBUG, TAG_VCW, "register callback");
256 g_stub_tidl_info->register_callback_requesting = true;
260 SLOG(LOG_ERROR, TAG_VCW, "Fail to rister callback(%d)", ret);
264 int vc_widget_tidl_open_connection()
266 SLOG(LOG_DEBUG, TAG_VCW, "[TIDL] vc_widget_tidl_open_connection");
267 pthread_mutex_lock(&g_w_tidl_mutex);
269 if (NULL != g_proxy_tidl_info) {
270 SLOG(LOG_ERROR, TAG_VCW, "[TIDL ERROR] g_proxy_tidl_info already created");
271 pthread_mutex_unlock(&g_w_tidl_mutex);
272 return VC_ERROR_NONE;
275 g_proxy_tidl_info = (vc_widget_tidl_info_s*)calloc(1, sizeof(vc_widget_tidl_info_s));
277 if (NULL == g_proxy_tidl_info) {
278 SLOG(LOG_ERROR, TAG_VCW, "[TIDL ERROR] Fail to create vc_widget_tidl_info_s");
279 pthread_mutex_unlock(&g_w_tidl_mutex);
280 return VC_ERROR_OUT_OF_MEMORY;
283 char* engine_app_id = vconf_get_str(VC_ENGINE_DB_DEFAULT);
284 if (NULL == engine_app_id) {
285 SLOG(LOG_ERROR, TAG_VCW, "[TIDL] vconf not found");
286 free(g_proxy_tidl_info);
287 g_proxy_tidl_info = NULL;
288 pthread_mutex_unlock(&g_w_tidl_mutex);
289 return VC_ERROR_ENGINE_NOT_FOUND;
292 g_proxy_tidl_info->rpc_h = __create_rpc_port(engine_app_id);
293 if (NULL == g_proxy_tidl_info->rpc_h) {
294 SLOG(LOG_ERROR, TAG_VCW, "[TIDL ERROR] Fail to create proxy");
296 free(g_proxy_tidl_info);
297 g_proxy_tidl_info = NULL;
298 pthread_mutex_unlock(&g_w_tidl_mutex);
299 return VC_ERROR_OPERATION_FAILED;
302 SLOG(LOG_INFO, TAG_VCW, "[TIDL] rpc_h(%p), engine_app_id(%s)", g_proxy_tidl_info->rpc_h, engine_app_id);
305 g_stub_tidl_info = (vcd_widget_tidl_info_s*)calloc(1, sizeof(vcd_widget_tidl_info_s));
307 if (NULL == g_stub_tidl_info) {
308 SLOG(LOG_ERROR, TAG_VCW, "[TIDL ERROR] Fail to create vcd_widget_tidl_info_s");
309 pthread_mutex_unlock(&g_w_tidl_mutex);
310 return VC_ERROR_OUT_OF_MEMORY;
313 __register_stub_callback();
315 pthread_mutex_unlock(&g_w_tidl_mutex);
317 return VC_ERROR_NONE;
320 int vc_widget_tidl_close_connection()
322 SLOG(LOG_DEBUG, TAG_VCW, "[TIDL] vc_widget_tidl_close_connection");
323 pthread_mutex_lock(&g_w_tidl_mutex);
325 if (NULL == g_proxy_tidl_info) {
326 SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Fail to get tidl info");
327 pthread_mutex_unlock(&g_w_tidl_mutex);
328 return VC_ERROR_OPERATION_FAILED;
331 if (0 != rpc_port_proxy_vc_widget_destroy(g_proxy_tidl_info->rpc_h)) {
332 SLOG(LOG_ERROR, TAG_VCW, "[TIDL ERROR] Fail to destroy tidl handle");
333 pthread_mutex_unlock(&g_w_tidl_mutex);
334 return VC_ERROR_OPERATION_FAILED;
337 g_proxy_tidl_info->rpc_h = NULL;
338 g_proxy_tidl_info->notify_cb_h = NULL;
340 free(g_proxy_tidl_info);
341 g_proxy_tidl_info = NULL;
343 free(g_stub_tidl_info);
344 g_stub_tidl_info = NULL;
346 pthread_mutex_unlock(&g_w_tidl_mutex);
348 return VC_ERROR_NONE;
351 static void __request_tidl_connect()
353 if (g_proxy_tidl_info->connection_requesting) {
357 int ret = rpc_port_proxy_vc_widget_connect(g_proxy_tidl_info->rpc_h);
358 SLOG(LOG_INFO, TAG_VCW, "[INFO] Request connection to stub. ret(%d)", ret);
361 g_proxy_tidl_info->connection_requesting = true;
365 static int __create_callback_handles()
367 if (NULL != g_proxy_tidl_info->notify_cb_h) {
368 rpc_port_proxy_vc_widget_notify_cb_dispose(g_proxy_tidl_info->rpc_h, g_proxy_tidl_info->notify_cb_h);
369 g_proxy_tidl_info->notify_cb_h = NULL;
372 if (RPC_PORT_ERROR_NONE != rpc_port_proxy_vc_widget_notify_cb_create(&g_proxy_tidl_info->notify_cb_h)) {
373 return VC_ERROR_OUT_OF_MEMORY;
376 rpc_port_proxy_vc_widget_notify_cb_set_callback(g_proxy_tidl_info->notify_cb_h, __notify_cb, NULL);
378 rpc_port_proxy_vc_widget_notify_cb_set_once(g_proxy_tidl_info->notify_cb_h, false);
380 return VC_ERROR_NONE;
383 static int __invoke_register_callback()
385 if (g_proxy_tidl_info->register_callback_invoked) {
386 SLOG(LOG_ERROR, TAG_VCW, "[INFO] Already register callback is invoked");
387 return VC_ERROR_NONE;
390 int ret = __create_callback_handles(g_proxy_tidl_info);
391 if (VC_ERROR_NONE != ret) {
392 SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Fail to create callback handle. ret(%d)", ret);
393 return VC_ERROR_OPERATION_FAILED;
396 rpc_port_proxy_vc_widget_invoke_register_cb(g_proxy_tidl_info->rpc_h, getpid(), g_proxy_tidl_info->notify_cb_h);
397 g_proxy_tidl_info->register_callback_invoked = true;
398 return VC_ERROR_NONE;
401 int vc_widget_tidl_request_hello()
403 SLOG(LOG_DEBUG, TAG_VCW, "[TIDL] vc_widget_tidl_request_hello");
405 if (NULL == g_proxy_tidl_info) {
406 SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Fail to get proxy tidl info");
407 return VC_ERROR_OPERATION_FAILED;
410 if (!g_proxy_tidl_info->connected) {
411 SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Proxy Not Connected");
412 __request_tidl_connect();
413 return VC_ERROR_OPERATION_FAILED;
416 if (VC_ERROR_NONE != __invoke_register_callback()) {
417 SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Fail to invoke register callback");
418 return VC_ERROR_OPERATION_FAILED;
421 if (NULL == g_stub_tidl_info) {
422 SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Fail to get stub tidl info");
423 return VC_ERROR_OPERATION_FAILED;
426 if (!g_stub_tidl_info->connected) {
427 SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Stub Not Connected");
428 __register_stub_callback();
429 return VC_ERROR_OPERATION_FAILED;
432 SLOG(LOG_DEBUG, TAG_VCW, ">>>>> VCW Hello");
434 SLOG(LOG_DEBUG, TAG_VCW, "<<<<");
436 return VC_ERROR_NONE;
439 int vc_widget_tidl_request_initialize(int pid, int* service_state, int* daemon_pid)
441 pthread_mutex_lock(&g_w_init_mutex);
442 SLOG(LOG_DEBUG, TAG_VCW, "[TIDL] vc_widget_tidl_request_initialize");
444 if (NULL == g_proxy_tidl_info) {
445 SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Fail to get tidl info");
446 pthread_mutex_unlock(&g_w_init_mutex);
447 return VC_ERROR_OPERATION_FAILED;
450 int temp_service_state = 0;
451 int temp_daemon_pid = 0;
452 int ret = rpc_port_proxy_vc_widget_invoke_initialize(g_proxy_tidl_info->rpc_h, pid, &temp_service_state, &temp_daemon_pid);
453 if (RPC_PORT_ERROR_NONE != ret) {
454 SLOG(LOG_ERROR, TAG_VCW, "[TIDL ERROR] Request vc widget initialize : Fail to invoke message, error(%d)", ret);
455 pthread_mutex_unlock(&g_w_init_mutex);
459 *service_state = temp_service_state;
460 *daemon_pid = temp_daemon_pid;
462 pthread_mutex_unlock(&g_w_init_mutex);
463 SLOG(LOG_DEBUG, TAG_VCW, "[TIDL] vc widget initialize: service_state(%d), daemon_pid(%d)", *service_state, *daemon_pid);
465 return VC_ERROR_NONE;
468 int vc_widget_tidl_request_finalize(int pid)
470 pthread_mutex_lock(&g_w_init_mutex);
471 SLOG(LOG_DEBUG, TAG_VCW, "[TIDL] vc_widget_tidl_request_finalize");
473 if (NULL == g_proxy_tidl_info) {
474 SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Fail to get tidl info");
475 pthread_mutex_unlock(&g_w_init_mutex);
476 return VC_ERROR_OPERATION_FAILED;
479 if (!g_proxy_tidl_info->connected) {
480 SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Not Connected");
481 pthread_mutex_unlock(&g_w_init_mutex);
482 return VC_ERROR_OPERATION_FAILED;
485 int ret = rpc_port_proxy_vc_widget_invoke_finalize(g_proxy_tidl_info->rpc_h, pid);
486 if (RPC_PORT_ERROR_NONE != ret) {
487 SLOG(LOG_ERROR, TAG_VCW, "[TIDL ERROR] Request vc widget finalize : Fail to invoke message, error(%d)", ret);
488 pthread_mutex_unlock(&g_w_init_mutex);
492 pthread_mutex_unlock(&g_w_init_mutex);
493 return VC_ERROR_NONE;
496 int vc_widget_tidl_request_start_recording(int pid, bool command)
498 SLOG(LOG_DEBUG, TAG_VCW, "[TIDL] vc_widget_tidl_request_start_recording");
500 if (NULL == g_proxy_tidl_info) {
501 SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Fail to get tidl info");
502 return VC_ERROR_OPERATION_FAILED;
505 if (!g_proxy_tidl_info->connected) {
506 SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Not Connected");
507 return VC_ERROR_OPERATION_FAILED;
510 int ret = rpc_port_proxy_vc_widget_invoke_start_recording(g_proxy_tidl_info->rpc_h, pid, (int)command);
511 if (RPC_PORT_ERROR_NONE != ret) {
512 SLOG(LOG_ERROR, TAG_VCW, "[TIDL ERROR] Request vc widget start recording : Fail to invoke message, error(%d)", ret);
516 return VC_ERROR_NONE;
519 int vc_widget_tidl_set_foreground(int pid, bool value)
521 SLOG(LOG_DEBUG, TAG_VCW, "[TIDL] vc_widget_tidl_set_foreground");
523 if (NULL == g_proxy_tidl_info) {
524 SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Fail to get tidl info");
525 return VC_ERROR_OPERATION_FAILED;
528 if (!g_proxy_tidl_info->connected) {
529 SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Not Connected");
530 return VC_ERROR_OPERATION_FAILED;
533 // TODO: Error tolerance cannot be applied because this function is asynchronous.
534 rpc_port_proxy_vc_widget_invoke_set_foreground(g_proxy_tidl_info->rpc_h, pid, (int)value);
536 return VC_ERROR_NONE;
539 int vc_widget_tidl_request_enable_asr_result(int pid, bool enable)
541 SLOG(LOG_DEBUG, TAG_VCW, "[TIDL] vc_widget_tidl_request_enable_asr_result");
543 if (NULL == g_proxy_tidl_info) {
544 SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Fail to get tidl info");
545 return VC_ERROR_OPERATION_FAILED;
548 if (!g_proxy_tidl_info->connected) {
549 SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Not Connected");
550 return VC_ERROR_OPERATION_FAILED;
553 int ret = rpc_port_proxy_vc_widget_invoke_enable_asr_result(g_proxy_tidl_info->rpc_h, pid, (int)enable);
554 if (RPC_PORT_ERROR_NONE != ret) {
555 SLOG(LOG_ERROR, TAG_VCW, "[TIDL ERROR] Request vc widget enable asr result : Fail to invoke message, error(%d)", ret);
559 return VC_ERROR_NONE;
562 int vc_widget_tidl_request_start(int pid, int silence)
564 SLOG(LOG_DEBUG, TAG_VCW, "[TIDL] vc_widget_tidl_request_start");
566 if (NULL == g_proxy_tidl_info) {
567 SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Fail to get tidl info");
568 return VC_ERROR_OPERATION_FAILED;
571 if (!g_proxy_tidl_info->connected) {
572 SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Not Connected");
573 return VC_ERROR_OPERATION_FAILED;
576 int ret = rpc_port_proxy_vc_widget_invoke_start(g_proxy_tidl_info->rpc_h, pid, silence);
577 if (RPC_PORT_ERROR_NONE != ret) {
578 SLOG(LOG_ERROR, TAG_VCW, "[TIDL ERROR] Request vc widget start : Fail to invoke message, error(%d)", ret);
582 return VC_ERROR_NONE;
585 int vc_widget_tidl_request_stop(int pid)
587 SLOG(LOG_DEBUG, TAG_VCW, "[TIDL] vc_widget_tidl_request_stop");
589 if (NULL == g_proxy_tidl_info) {
590 SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Fail to get tidl info");
591 return VC_ERROR_OPERATION_FAILED;
594 if (!g_proxy_tidl_info->connected) {
595 SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Not Connected");
596 return VC_ERROR_OPERATION_FAILED;
599 int ret = rpc_port_proxy_vc_widget_invoke_stop(g_proxy_tidl_info->rpc_h, pid);
600 if (RPC_PORT_ERROR_NONE != ret) {
601 SLOG(LOG_ERROR, TAG_VCW, "[TIDL ERROR] Request vc widget stop : Fail to invoke message, error(%d)", ret);
605 return VC_ERROR_NONE;
608 int vc_widget_tidl_request_cancel(int pid)
610 SLOG(LOG_DEBUG, TAG_VCW, "[TIDL] vc_widget_tidl_request_cancel");
612 if (NULL == g_proxy_tidl_info) {
613 SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Fail to get tidl info");
614 return VC_ERROR_OPERATION_FAILED;
617 if (!g_proxy_tidl_info->connected) {
618 SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Not Connected");
619 return VC_ERROR_OPERATION_FAILED;
622 int ret = rpc_port_proxy_vc_widget_invoke_cancel(g_proxy_tidl_info->rpc_h, pid);
623 if (RPC_PORT_ERROR_NONE != ret) {
624 SLOG(LOG_ERROR, TAG_VCW, "[TIDL ERROR] Request vc widget cancel : Fail to invoke message, error(%d)", ret);
628 return VC_ERROR_NONE;