Change command collect timing 02/110002/1
authorKwangyoun Kim <ky85.kim@samsung.com>
Wed, 4 Jan 2017 08:13:48 +0000 (17:13 +0900)
committerWonnam Jang <wn.jang@samsung.com>
Thu, 12 Jan 2017 11:01:03 +0000 (03:01 -0800)
Change-Id: I974664edf6c44dd7148b46c249bef55549e875bb
(cherry picked from commit 705d95e146a43803ff7184b5ee087a607ef8a6f9)

server/vcd_client_data.c
server/vcd_server.c

index 562b77a..010bde0 100644 (file)
@@ -444,6 +444,16 @@ int vcd_client_foreach_command(client_foreach_command_cb callback, void* user_da
                return VCD_ERROR_INVALID_PARAMETER;
        }
 
+       if (0 != vcd_client_command_collect_command()) {
+               SLOG(LOG_ERROR, TAG_VCD, "[Client Data ERROR] Fail to collect command");
+               return VCD_ERROR_OPERATION_FAILED;
+       }
+
+       if (0 >= vcd_client_get_length()) {
+               SLOG(LOG_ERROR, TAG_VCD, "[Client Data ERROR] No current command");
+               return VCD_ERROR_OPERATION_FAILED;
+       }
+
 //     int id_count = 1;
        GSList *iter = NULL;
        vc_cmd_s* temp_cmd;
@@ -1380,4 +1390,4 @@ int vcd_client_widget_get_asr_result_enabled(int pid, bool* enable)
        *enable = info->asr_result_enabled;
 
        return 0;
-}
\ No newline at end of file
+}
index cd4088d..dcefbac 100755 (executable)
@@ -1451,19 +1451,6 @@ static int __start_internal_recognition()
 {
        int ret;
 
-       /* 2. Get commands */
-       ret = vcd_client_command_collect_command();
-       if (0 != ret) {
-               SLOG(LOG_ERROR, TAG_VCD, "[Server ERROR] Fail to collect command : %d", ret);
-               return VCD_ERROR_OPERATION_FAILED;
-       }
-
-       ret = vcd_client_get_length();
-       if (0 == ret) {
-               SLOG(LOG_WARN, TAG_VCD, "[Server WARNIING] No current command : %d", ret);
-               return VCD_ERROR_OPERATION_FAILED;
-       }
-
        /* 3. Set command to engine */
        ret = vcd_engine_set_commands();
        if (0 != ret) {