static Ecore_Timer* g_check_state_timer = NULL;
-static Ecore_Timer* g_hello_timer;
-
/* for repetition */
static char* g_language = NULL;
} else {
if (key && 0 == strncmp(key, "start", strlen(key))) {
if (val && (0 == strncmp(val, "update", strlen(val) || 0 == strncmp(val, "uninstall", strlen(val))))) {
- SLOG(LOG_INFO, TAG_TTSC, "[INFO] start to install.");
+ SLOG(LOG_ERROR, TAG_TTSC, "[INFO] start to install.");
g_engine_update_status = 1;
}
} else if (key && 0 == strncmp(key, "end", strlen(key))) {
- SLOG(LOG_INFO, TAG_TTSC, "[INFO] finish to install");
+ SLOG(LOG_ERROR, TAG_TTSC, "[INFO] finish to install");
g_engine_update_status = 0;
}
}
if (NULL == g_pkgmgr) {
SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Fail to create pkgmgr handle");
} else {
- if (pkgmgr_client_listen_status(g_pkgmgr, __pkgmgr_status_cb, NULL) < 0) {
- SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Fail to listen pkgmgr status. remove and recreate client");
+ int ret = pkgmgr_client_set_status_type(g_pkgmgr, PKGMGR_CLIENT_STATUS_UNINSTALL | PKGMGR_CLIENT_STATUS_UPGRADE);
+ if (0 == ret) {
+ if (pkgmgr_client_listen_status(g_pkgmgr, __pkgmgr_status_cb, NULL) < 0) {
+ SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Fail to listen pkgmgr status. remove and recreate client");
+ pkgmgr_client_free(g_pkgmgr);
+ g_pkgmgr = NULL;
+ usleep(10000);
+ continue;
+ } else {
+ SLOG(LOG_ERROR, TAG_TTSC, "[INFO] Succeed to register pkgmgr cb");
+ }
+ } else {
+ SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Fail to set status type on pkgmgr, ret(%d)", ret);
pkgmgr_client_free(g_pkgmgr);
g_pkgmgr = NULL;
+ usleep(10000);
continue;
- } else {
- SLOG(LOG_ERROR, TAG_TTSC, "[DEBUG] Succeed to register pkgmgr cb");
}
}
usleep(10000);
return TTS_ERROR_OPERATION_FAILED;
}
+ SLOG(LOG_ERROR, TAG_TTSC, "[INFO] tts_h(%p), tts_client(%p), uid(%d)", tts, client, client->uid);
+
int ret = tts_config_mgr_initialize(client->uid);
if (0 != ret) {
SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Fail to init config manager : %d", ret);
return TTS_ERROR_INVALID_PARAMETER;
}
+ SLOG(LOG_ERROR, TAG_TTSC, "[INFO] tts_h(%p), tts_client(%p), uid(%d)", tts, client, client->uid);
+
/* check used callback */
if (0 != tts_client_get_use_callback(client)) {
SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Cannot destroy in Callback function");
return TTS_ERROR_OPERATION_FAILED;
}
- pthread_mutex_lock(&g_pkgmgr_mutex);
- if (g_pkgmgr) {
- pkgmgr_client_remove_listen_status(g_pkgmgr);
- pkgmgr_client_free(g_pkgmgr);
- g_pkgmgr = NULL;
- }
- pthread_mutex_unlock(&g_pkgmgr_mutex);
-
tts_config_mgr_finalize(client->uid);
+ if (client->hello_timer) {
+ ecore_timer_del(client->hello_timer);
+ client->hello_timer = NULL;
+ }
+
int ret = -1;
int count = 0;
int screen_reader = -1;
break;
}
- if (0 == tts_client_get_size()) {
+ int num_of_client = tts_client_get_size();
+ if (0 == num_of_client) {
+ SLOG(LOG_ERROR, TAG_TTSC, "[INFO] all clients are destroied");
if (0 != tts_dbus_close_connection()) {
SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Fail to close connection");
}
+ pthread_mutex_lock(&g_pkgmgr_mutex);
+ if (g_pkgmgr) {
+ pkgmgr_client_remove_listen_status(g_pkgmgr);
+ pkgmgr_client_free(g_pkgmgr);
+ g_pkgmgr = NULL;
+ }
+ pthread_mutex_unlock(&g_pkgmgr_mutex);
+ } else {
+ SLOG(LOG_ERROR, TAG_TTSC, "[INFO] num_of_client(%d)", num_of_client);
}
if (NULL != g_language) {
return TTS_ERROR_OPERATION_FAILED;
}
- if (g_hello_timer) {
- ecore_timer_del(g_hello_timer);
- g_hello_timer = NULL;
+ if (client->hello_timer) {
+ ecore_timer_del(client->hello_timer);
+ client->hello_timer = NULL;
}
if (TTS_STATE_READY == client->current_state) {
/* check handle */
if (NULL == client) {
SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] A handle is not valid");
- g_hello_timer = NULL;
return EINA_FALSE;
}
/* check state */
if (client->current_state == TTS_STATE_READY) {
SLOG(LOG_ERROR, TAG_TTSC, "[INFO] TTS client has been already connected to tts service"); //LCOV_EXCL_LINE
- SLOG(LOG_DEBUG, TAG_TTSC, "@@@");
- g_hello_timer = NULL;
+ SLOG(LOG_ERROR, TAG_TTSC, "@@@");
+ client->hello_timer = NULL;
return EINA_FALSE;
}
+ SLOG(LOG_ERROR, TAG_TTSC, "[INFO] tts_h(%p), tts_client(%p), uid(%d)", tts, client, client->uid);
+
/* check whether engine is updating or not */
if (g_engine_update_status) {
SLOG(LOG_ERROR, TAG_TTSC, "[DEBUG] cannot prepare due to engine update");
__tts_cb_error(-1, TTS_ERROR_SERVICE_RESET, -1, "Daemon Reset");
- g_hello_timer = NULL;
+ client->hello_timer = NULL;
return EINA_FALSE;
}
if (TTS_HELLO_RETRY_COUNT == g_retry_cnt) {
SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Stop to send hello, retry count reaches the limit");
g_retry_cnt = 0;
- g_hello_timer = NULL;
+ client->hello_timer = NULL;
return EINA_FALSE;
}
- if (!g_hello_timer) {
+ if (!client->hello_timer) {
SLOG(LOG_ERROR, TAG_TTSC, "@@@ Call checking Hello timer callback");
- g_hello_timer = ecore_timer_add(0.5, __send_hello, tts);
+ client->hello_timer = ecore_timer_add(0.5, __send_hello, tts);
return EINA_FALSE;
}
return EINA_TRUE;
return TTS_ERROR_INVALID_STATE;
}
- if (NULL == g_hello_timer) {
+ SLOG(LOG_ERROR, TAG_TTSC, "[INFO] tts_h(%p), tts_client(%p), uid(%d)", tts, client, client->uid);
+
+ if (NULL == client->hello_timer) {
SLOG(LOG_ERROR, TAG_TTSC, "@@@ Call checking Hello timer callback");
g_retry_cnt = 0;
ecore_thread_main_loop_begin();
return TTS_ERROR_INVALID_STATE;
}
+ SLOG(LOG_ERROR, TAG_TTSC, "[INFO] tts_h(%p), tts_client(%p), uid(%d)", tts, client, client->uid);
+
+ if (client->hello_timer) {
+ ecore_timer_del(client->hello_timer);
+ client->hello_timer = NULL;
+ }
+
int ret = -1;
int count = 0;
int screen_reader = -1;
*state = client->current_state;
switch (*state) {
- case TTS_STATE_CREATED: SLOG(LOG_DEBUG, TAG_TTSC, "Current state is 'Created'"); break;
- case TTS_STATE_READY: SLOG(LOG_DEBUG, TAG_TTSC, "Current state is 'Ready'"); break;
- case TTS_STATE_PLAYING: SLOG(LOG_DEBUG, TAG_TTSC, "Current state is 'Playing'"); break;
- case TTS_STATE_PAUSED: SLOG(LOG_DEBUG, TAG_TTSC, "Current state is 'Paused'"); break;
+ case TTS_STATE_CREATED: SLOG(LOG_INFO, TAG_TTSC, "Current state is 'Created'"); break;
+ case TTS_STATE_READY: SLOG(LOG_INFO, TAG_TTSC, "Current state is 'Ready'"); break;
+ case TTS_STATE_PLAYING: SLOG(LOG_INFO, TAG_TTSC, "Current state is 'Playing'"); break;
+ case TTS_STATE_PAUSED: SLOG(LOG_INFO, TAG_TTSC, "Current state is 'Paused'"); break;
default: SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Invalid value"); break;
}
int tts_add_text(tts_h tts, const char* text, const char* language, int voice_type, int speed, int* utt_id)
{
- SLOG(LOG_INFO, TAG_TTSC, "[DEBUG] Add text: text(%s), language(%s), type(%d)", (NULL == text) ? "NULL" : text, (NULL == language) ? "NULL" : language, voice_type);
+ SLOG(LOG_ERROR, TAG_TTSC, "[INFO] Add text: text(%s), language(%s), type(%d)", (NULL == text) ? "NULL" : text, (NULL == language) ? "NULL" : language, voice_type);
if (0 != __tts_get_feature_enabled()) {
return TTS_ERROR_NOT_SUPPORTED;