Delete processing timer at main thread 01/203501/1
authorsooyeon.kim <sooyeon.kim@samsung.com>
Mon, 28 Jan 2019 08:32:47 +0000 (17:32 +0900)
committerSooyeon Kim <sooyeon.kim@samsung.com>
Mon, 15 Apr 2019 08:57:50 +0000 (08:57 +0000)
Change-Id: I0595c67ab03efab92e29d93053c9af09a9bd2b8e
Signed-off-by: sooyeon.kim <sooyeon.kim@samsung.com>
(cherry picked from commit fb9c73980096c07f9ca28bdb1ccc078748355780)

common/stt_engine.c
server/sttd_server.c

index 14e6276..57944a2 100644 (file)
@@ -557,7 +557,7 @@ int stt_engine_check_app_agreed(const char* appid, bool* is_agreed)
                return 0;
        }
 
-       SLOG(LOG_INFO, stt_tag(), "[Engine Info] request to app agreed, appid(%s), is_agreed(%d)", appid, is_agreed);
+       SLOG(LOG_INFO, stt_tag(), "[Engine Info] request to app agreed, appid(%s), is_agreed(%d)", appid, *is_agreed);
 
        int ret = g_engine->callback->check_app_agreed(appid, is_agreed);
        if (0 != ret) {
index f1bda74..ccaf29d 100644 (file)
@@ -216,8 +216,11 @@ int __server_recognition_result_callback(stte_result_event_e event, const char*
 
                /* Delete timer for processing time out */
                if (NULL != g_processing_timer) {
+                       ecore_thread_main_loop_begin();
+                       SLOG(LOG_INFO, TAG_STTD, "[INFO] Delete g_processing_timer");
                        ecore_timer_del(g_processing_timer);
                        g_processing_timer = NULL;
+                       ecore_thread_main_loop_end();
                }
 
                sttd_config_time_save();
@@ -272,8 +275,11 @@ int __server_recognition_result_callback(stte_result_event_e event, const char*
 
                /* Delete timer for processing time out */
                if (NULL != g_processing_timer) {
+                       ecore_thread_main_loop_begin();
+                       SLOG(LOG_INFO, TAG_STTD, "[INFO] Delete g_processing_timer");
                        ecore_timer_del(g_processing_timer);
                        g_processing_timer = NULL;
+                       ecore_thread_main_loop_end();
                }
                sttd_config_time_reset();
 
@@ -707,6 +713,7 @@ int sttd_server_finalize(int uid)
 
                if (APP_STATE_PROCESSING == state) {
                        if (NULL != g_processing_timer) {
+                               SLOG(LOG_INFO, TAG_STTD, "[INFO] Delete g_processing_timer");
                                ecore_timer_del(g_processing_timer);
                                g_processing_timer = NULL;
                        }
@@ -1185,6 +1192,7 @@ int sttd_server_start(int uid, const char* lang, const char* recognition_type, i
        }
 
        if (NULL != g_processing_timer) {
+               SLOG(LOG_INFO, TAG_STTD, "[INFO] Delete g_processing_timer");
                ecore_timer_del(g_processing_timer);
                g_processing_timer = NULL;
        }
@@ -1304,6 +1312,7 @@ int sttd_server_start(int uid, const char* lang, const char* recognition_type, i
 Eina_Bool __time_out_for_processing(void *data)
 {
        if (NULL != g_processing_timer) {
+               SLOG(LOG_INFO, TAG_STTD, "[INFO] Delete g_processing_timer");
                ecore_timer_del(g_processing_timer);
                g_processing_timer = NULL;
        }
@@ -1402,6 +1411,7 @@ int sttd_server_stop(int uid)
        }
 
        if (NULL != g_processing_timer) {
+               SLOG(LOG_INFO, TAG_STTD, "[INFO] Delete g_processing_timer");
                ecore_timer_del(g_processing_timer);
                g_processing_timer = NULL;
        }
@@ -1447,6 +1457,7 @@ int sttd_server_stop(int uid)
                }
                free(sound);
 
+               SLOG(LOG_INFO, TAG_STTD, "[INFO] Add g_processing_timer");
                g_processing_timer = ecore_timer_add(g_processing_timeout, __time_out_for_processing, NULL);
 
                return STTD_RESULT_STATE_NOT_DONE;
@@ -1476,6 +1487,7 @@ int sttd_server_stop(int uid)
 
                SLOG(LOG_INFO, TAG_STTD, "[Server SUCCESS] Stop recognition");
 
+               SLOG(LOG_INFO, TAG_STTD, "[INFO] Add g_processing_timer");
                g_processing_timer = ecore_timer_add(g_processing_timeout, __time_out_for_processing, NULL);
 
                return STTD_RESULT_STATE_DONE;
@@ -1509,6 +1521,7 @@ int sttd_server_cancel(int uid)
        }
 
        if (NULL != g_processing_timer) {
+               SLOG(LOG_INFO, TAG_STTD, "[INFO] Delete g_processing_timer");
                ecore_timer_del(g_processing_timer);
                g_processing_timer = NULL;
        }
@@ -1682,6 +1695,7 @@ int sttd_server_cancel_file(int uid)
        }
 
        if (NULL != g_processing_timer) {
+               SLOG(LOG_INFO, TAG_STTD, "[INFO] Delete g_processing_timer");
                ecore_timer_del(g_processing_timer);
                g_processing_timer = NULL;
        }