/* check handle */
if (true == vc_client_is_valid(g_vc)) {
- SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Already initialized");
- return VC_ERROR_INVALID_STATE;
+ SLOG(LOG_DEBUG, TAG_VCC, "[DEBUG] Already initialized");
+ return VC_ERROR_NONE;
}
if (0 < vc_client_get_count()) {
SLOG(LOG_DEBUG, TAG_VCC, "[DEBUG] Already initialized");
- return VC_ERROR_INVALID_STATE;
+ return VC_ERROR_NONE;
}
if (0 != vc_dbus_open_connection()) {
return VC_ERROR_NONE;
}
+int vc_prepare_sync(void)
+{
+ if (0 != __vc_get_feature_enabled()) {
+ return VC_ERROR_NOT_SUPPORTED;
+ }
+ if (0 != __vc_check_privilege()) {
+ return VC_ERROR_PERMISSION_DENIED;
+ }
+
+ SLOG(LOG_DEBUG, TAG_VCC, "@@@ [Client] Prepare");
+
+ vc_state_e state;
+ if (0 != vc_client_get_client_state(g_vc, &state)) {
+ SLOG(LOG_ERROR, TAG_VCC, "[ERROR] A handle is not available");
+ SLOG(LOG_DEBUG, TAG_VCC, "@@@");
+ return VC_ERROR_INVALID_STATE;
+ }
+
+ /* check state */
+ if (state != VC_STATE_INITIALIZED) {
+ SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Invalid State: Current state is not 'CREATED'");
+ SLOG(LOG_DEBUG, TAG_VCC, "@@@");
+ return VC_ERROR_INVALID_STATE;
+ }
+
+ while (EINA_TRUE == __vc_connect_daemon(NULL));
+
+ SLOG(LOG_DEBUG, TAG_VCC, "@@@");
+
+ return VC_ERROR_NONE;
+}
+
int vc_unprepare(void)
{
if (0 != __vc_get_feature_enabled()) {