}
} /* VCD_METHOD_HELLO */
- else if (0 == strncmp(VCD_WIDGET_METHOD_SET_SERVICE_STATE, method, strlen(VCD_WIDGET_METHOD_SET_SERVICE_STATE))) {
+ else if (0 == strncmp(VCD_METHOD_SET_SERVICE_STATE, method, strlen(VCD_METHOD_SET_SERVICE_STATE))) {
bundle_get_str(msg, VC_BUNDLE_SERVICE_STATE, &val);
int state = 0;
if (val) {
SLOG(LOG_INFO, TAG_VCW, "@@ service state changed : %d", state);
__vc_widget_cb_service_state(state);
}
- } /* VCD_WIDGET_METHOD_SET_SERVICE_STATE */
+ } /* VCD_METHOD_SET_SERVICE_STATE */
else if (0 == strncmp(VCD_WIDGET_METHOD_SHOW_TOOLTIP, method, strlen(VCD_WIDGET_METHOD_SHOW_TOOLTIP))) {
SLOG(LOG_DEBUG, TAG_VCW, "@@@ Show / Hide tooltip");
SLOG(LOG_INFO, TAG_VCW, "Disonnected to server");
- SLOG(LOG_INFO, TAG_VCW, "Re-connection start");
- __vc_widget_cb_error(VC_ERROR_SERVICE_RESET, -1, "Server Disconnected, re-launch");
+ __vc_widget_cb_error(VC_ERROR_SERVICE_RESET, -1, "Server Disconnected");
}
static void __on_rejected(rpc_port_proxy_vc_widget_proxy_vc_widget_h h, void *user_data)
return VC_ERROR_NONE;
}
+static int __convert_unhandled_error(int ret)
+{
+ if (RPC_PORT_ERROR_IO_ERROR == ret || RPC_PORT_ERROR_OUT_OF_MEMORY == ret) {
+ return VC_ERROR_OPERATION_FAILED;
+ }
+
+ return ret;
+}
+
static void __request_tidl_connect()
{
if (g_proxy_tidl_info->connection_requesting) {
int temp_service_state = 0;
int temp_daemon_pid = 0;
int ret = rpc_port_proxy_vc_widget_proxy_vc_widget_invoke_initialize(g_proxy_tidl_info->rpc_h, pid, &temp_service_state, &temp_daemon_pid);
- if (RPC_PORT_ERROR_NONE != ret) {
+ int exception = get_last_result();
+ if (RPC_PORT_ERROR_NONE != exception) {
+ ret = __convert_unhandled_error(exception);
+ }
+
+ if (VC_ERROR_NONE != ret) {
SLOG(LOG_ERROR, TAG_VCW, "[TIDL ERROR] Request vc widget initialize : Fail to invoke message, error(%d)", ret);
pthread_mutex_unlock(&g_w_init_mutex);
return ret;
}
int ret = rpc_port_proxy_vc_widget_proxy_vc_widget_invoke_finalize(g_proxy_tidl_info->rpc_h, pid);
- if (RPC_PORT_ERROR_NONE != ret) {
- SLOG(LOG_ERROR, TAG_VCW, "[TIDL ERROR] Request vc widget finalize : Fail to invoke message, error(%d)", ret);
+ int exception = get_last_result();
+ if (RPC_PORT_ERROR_NONE != exception) {
+ ret = __convert_unhandled_error(exception);
+ }
+
+ if (VC_ERROR_NONE != ret) {
+ SLOG(LOG_ERROR, TAG_VCW, "[TIDL ERROR] Request vc widget finalize : Fail to invoke finalize, error(%d)", ret);
+ pthread_mutex_unlock(&g_w_init_mutex);
+ return ret;
+ }
+
+ ret = rpc_port_proxy_vc_widget_proxy_vc_widget_disconnect(g_proxy_tidl_info->rpc_h);
+ exception = get_last_result();
+ if (RPC_PORT_ERROR_NONE != exception) {
+ ret = __convert_unhandled_error(exception);
+ }
+
+ if (VC_ERROR_NONE != ret) {
+ SLOG(LOG_ERROR, TAG_VCW, "[TIDL ERROR] Request vc widget finalize : Fail to disconnect, error(%d)", ret);
pthread_mutex_unlock(&g_w_init_mutex);
return ret;
}
}
int ret = rpc_port_proxy_vc_widget_proxy_vc_widget_invoke_start_recording(g_proxy_tidl_info->rpc_h, pid, (int)command);
- if (RPC_PORT_ERROR_NONE != ret) {
+ int exception = get_last_result();
+ if (RPC_PORT_ERROR_NONE != exception) {
+ ret = __convert_unhandled_error(exception);
+ }
+
+ if (VC_ERROR_NONE != ret) {
SLOG(LOG_ERROR, TAG_VCW, "[TIDL ERROR] Request vc widget start recording : Fail to invoke message, error(%d)", ret);
return ret;
}
}
int ret = rpc_port_proxy_vc_widget_proxy_vc_widget_invoke_enable_asr_result(g_proxy_tidl_info->rpc_h, pid, (int)enable);
- if (RPC_PORT_ERROR_NONE != ret) {
+ int exception = get_last_result();
+ if (RPC_PORT_ERROR_NONE != exception) {
+ ret = __convert_unhandled_error(exception);
+ }
+
+ if (VC_ERROR_NONE != ret) {
SLOG(LOG_ERROR, TAG_VCW, "[TIDL ERROR] Request vc widget enable asr result : Fail to invoke message, error(%d)", ret);
return ret;
}
}
int ret = rpc_port_proxy_vc_widget_proxy_vc_widget_invoke_start(g_proxy_tidl_info->rpc_h, pid, silence);
- if (RPC_PORT_ERROR_NONE != ret) {
+ int exception = get_last_result();
+ if (RPC_PORT_ERROR_NONE != exception) {
+ ret = __convert_unhandled_error(exception);
+ }
+
+ if (VC_ERROR_NONE != ret) {
SLOG(LOG_ERROR, TAG_VCW, "[TIDL ERROR] Request vc widget start : Fail to invoke message, error(%d)", ret);
return ret;
}
}
int ret = rpc_port_proxy_vc_widget_proxy_vc_widget_invoke_stop(g_proxy_tidl_info->rpc_h, pid);
- if (RPC_PORT_ERROR_NONE != ret) {
+ int exception = get_last_result();
+ if (RPC_PORT_ERROR_NONE != exception) {
+ ret = __convert_unhandled_error(exception);
+ }
+
+ if (VC_ERROR_NONE != ret) {
SLOG(LOG_ERROR, TAG_VCW, "[TIDL ERROR] Request vc widget stop : Fail to invoke message, error(%d)", ret);
return ret;
}
}
int ret = rpc_port_proxy_vc_widget_proxy_vc_widget_invoke_cancel(g_proxy_tidl_info->rpc_h, pid);
- if (RPC_PORT_ERROR_NONE != ret) {
+ int exception = get_last_result();
+ if (RPC_PORT_ERROR_NONE != exception) {
+ ret = __convert_unhandled_error(exception);
+ }
+
+ if (VC_ERROR_NONE != ret) {
SLOG(LOG_ERROR, TAG_VCW, "[TIDL ERROR] Request vc widget cancel : Fail to invoke message, error(%d)", ret);
return ret;
}