Add engine update checker into __send_hello
[platform/core/uifw/tts.git] / client / tts.c
index 1c78f22..3ec8220 100644 (file)
@@ -899,6 +899,14 @@ static Eina_Bool __send_hello(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");
+               g_hello_timer = NULL;
+               return EINA_FALSE;
+       }
+
        /* Send hello */
        int ret = tts_dbus_request_hello(client->uid);
        if (0 != ret)  {
@@ -911,6 +919,7 @@ static Eina_Bool __send_hello(void *data)
        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;
                return EINA_FALSE;
        }