static int g_engine_update_status = 0;
static pthread_mutex_t g_pkgmgr_mutex = PTHREAD_MUTEX_INITIALIZER;
static Ecore_Thread* g_pkgmgr_thread = NULL;
-
+static bool __is_engine_launched(const char* appid);
/* Function definition */
static Eina_Bool __tts_notify_state_changed(void *data);
return EINA_FALSE;
}
- /* 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");
+ bool is_launched = __is_engine_launched(g_engine_appid);
+ SLOG(LOG_INFO, TAG_TTSC, "[INFO] tts engine is launched(%d)", is_launched);
- return EINA_FALSE;
+ if (false == is_launched) {
+ /* 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");
+
+ return EINA_FALSE;
+ }
}
/* Send hello */
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");
- client->hello_timer = NULL;
- return EINA_FALSE;
+ bool is_launched = __is_engine_launched(g_engine_appid);
+ SLOG(LOG_INFO, TAG_TTSC, "[INFO] tts engine is launched(%d)", is_launched);
+
+ if (false == is_launched) {
+ /* If engine is NOT launched, 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");
+ client->hello_timer = NULL;
+ return EINA_FALSE;
+ }
}
/* Send hello */
g_retry_cnt = 0;
client->hello_timer = NULL;
- bool is_launched = __is_engine_launched(g_engine_appid);
+ is_launched = __is_engine_launched(g_engine_appid);
SLOG(LOG_INFO, TAG_TTSC, "[INFO] tts engine is launched(%d)", is_launched);
return EINA_FALSE;