Cause: The on_disconnect() cb is called, even a client requtests to disconnect.
Change-Id: I463ad1321968cc86b775125b220dfc8f1ce8b9b3
Solution: Check whether ipc listening state or not when tries to reconnect.
SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to request finalize : %s", __vc_get_error_code(ret)); //LCOV_EXCL_LINE
}
+ /* TODO set_start_listening should be move to proper place */
+ vc_client_set_start_listening(false);
+
if (NULL != g_focus_in_handler) {
ecore_event_handler_del(g_focus_in_handler);
g_focus_in_handler = NULL;
SLOG(LOG_ERROR, TAG_VCC, "[Not ERROR] The current client is not valid. It is destroyed."); //LCOV_EXCL_LINE
return EINA_FALSE;
}
+ /* TODO set_start_listening should be move to proper place */
+ vc_client_set_start_listening(true);
SLOG(LOG_DEBUG, TAG_VCC, "@@@ [Client] Connect daemon DONE");
/* Invocation name */
char* invocation_name;
+
+ /* Listening IPC message from service */
+ bool start_listening;
} vc_client_s;
static vc_client_s *g_client = NULL;
g_client->is_foreground = false;
g_client->invocation_name = NULL;
+ g_client->start_listening = false;
SLOG(LOG_INFO, TAG_VCC, "[INFO] client create. pid(%u)", g_client->pid);
return VC_ERROR_NONE;
}
+
+int vc_client_set_start_listening(bool is_listening_started)
+{
+ if (NULL == g_client)
+ return VC_ERROR_INVALID_PARAMETER;
+
+ g_client->start_listening = is_listening_started;
+ return VC_ERROR_NONE;
+}
+
+bool vc_client_is_listening_started()
+{
+ if (NULL == g_client)
+ return false;
+
+ return g_client->start_listening;
+}
\ No newline at end of file
int vc_client_get_tts_utterance_status_cb(vc_tts_utterance_status_cb* callback, void** user_data);
+int vc_client_set_start_listening(bool is_listening_started);
+
+bool vc_client_is_listening_started();
#ifdef __cplusplus
}
#include "vc_tidl.h"
#include "vc_proxy.h"
#include "vc_main.h"
+#include "vc_client.h"
#include <vconf.h>
/* retry to connect */
SLOG(LOG_INFO, TAG_VCC, "[INFO] Disconnected to server");
- __vc_cb_error(VC_ERROR_SERVICE_RESET, "Server Disconnected");
-
+ if (vc_client_is_listening_started()) {
+ __vc_cb_error(VC_ERROR_SERVICE_RESET, "Server Disconnected");
+ }
}
static void __on_rejected(rpc_port_proxy_vc_proxy_vc_h h, void* user_data)
return ret;
}
- ret = rpc_port_proxy_vc_proxy_vc_disconnect(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_VCC, ">>>> Request vc finalize : Fail to disconnect. err(%d)", ret);
- return ret;
- }
-
SLOG(LOG_DEBUG, TAG_VCC, "@@ vc finalize : result = %d", ret);
return VC_ERROR_NONE;