Merge "Reset waiting flag when recognition starts by widget" into tizen
authorWonnam Jang <wn.jang@samsung.com>
Thu, 25 Jan 2018 06:25:01 +0000 (06:25 +0000)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Thu, 25 Jan 2018 06:25:01 +0000 (06:25 +0000)
1  2 
server/vcd_server.c

diff --combined server/vcd_server.c
@@@ -400,7 -400,7 +400,7 @@@ static Eina_Bool __vcd_send_selected_re
                                                        SLOG(LOG_WARN, TAG_VCD, "[Server WARNING] Fail to send result, ret(%d)", ret);
                                                        break;
                                                } else {
 -                                                      SLOG(LOG_DEBUG, TAG_VCD, "[Server] Send result : pid(%d) type(%d)", temp_cmd->pid, temp_cmd->type);
 +                                                      SLOG(LOG_ERROR, TAG_VCD, "[Server] Send result : pid(%d) type(%d)", temp_cmd->pid, temp_cmd->type);
                                                        pre_pid = temp_cmd->pid;
                                                        pre_type = temp_cmd->type;
                                                }
@@@ -440,7 -440,6 +440,7 @@@ int vcd_send_nlg_result(const char* nlg
                return ret;
        }
  
 +      SLOG(LOG_ERROR, TAG_VCD, "[Server] send dialog : mgr_pid(%d), nlg_result(%s)", vcd_client_manager_get_pid(), nlg_result);
        ret = vcdc_send_dialog(vcd_client_manager_get_pid(), -1, nlg_result, NULL, 0); //0: VC_DIALOG_END
        if (0 != ret)
                SECURE_SLOG(LOG_ERROR, TAG_VCD, "[Server ERROR] Fail to send dialog : mgr_pid(%d), nlg_result(%s)", vcd_client_manager_get_pid(), nlg_result);
@@@ -470,8 -469,6 +470,8 @@@ int vcd_send_result(vce_result_event_e 
        SECURE_SLOG(LOG_INFO, TAG_VCD, "[Server] Event(%d), Text(%s) Nonfixed(%s) Msg(%s) Result count(%d)",
                event, all_result, non_fixed_result, msg, count);
  
 +      SLOG(LOG_ERROR, TAG_VCD, "[Server] NLU result(%s)", nlu_result);
 +
        if (VCD_RECOGNITION_MODE_RESTART_AFTER_REJECT == vcd_client_get_recognition_mode()) {
                if (VCE_RESULT_EVENT_REJECTED == event) {
                        SLOG(LOG_DEBUG, TAG_VCD, "[Server] Restart by no or rejected result");
                                                if (true == is_consumed) {
                                                        if (NULL != user_info) {
                                                                *user_info = 0x01;
 -                                                              SLOG(LOG_DEBUG, TAG_VCD, "[Server] Send whether ASR result is consumed or not (%d)", *user_info);
 +                                                              SLOG(LOG_ERROR, TAG_VCD, "[Server] Send whether ASR result is consumed or not (%d)", *user_info);
                                                        }
                                                        vcdc_send_show_tooltip(pid, false);
                                                        if (-1 != vcd_client_manager_get_pid()) {
@@@ -1027,7 -1024,7 +1027,7 @@@ int vcd_initialize(vce_request_callback
        vcd_config_set_service_state(VCD_STATE_READY);
        vcdc_send_service_state(VCD_STATE_READY);
  
 -      SLOG(LOG_DEBUG, TAG_VCD, "[Server SUCCESS] initialize");
 +      SLOG(LOG_ERROR, TAG_VCD, "[Server SUCCESS] initialize");
  
        return 0;
  }
@@@ -1072,7 -1069,7 +1072,7 @@@ void vcd_finalize(
        vcd_config_set_service_state(VCD_STATE_NONE);
        vcdc_send_service_state(VCD_STATE_NONE);
  
 -      SLOG(LOG_DEBUG, TAG_VCD, "[Server] mode finalize");
 +      SLOG(LOG_ERROR, TAG_VCD, "[Server] mode finalize");
  
        return;
  }
@@@ -1328,7 -1325,7 +1328,7 @@@ int vcd_server_mgr_initialize(int pid
        if (0 != vcdc_send_manager_pid(pid))
                SLOG(LOG_WARN, TAG_VCD, "[Server WARNING] Fail to send manager pid");
  
 -      SLOG(LOG_DEBUG, TAG_VCD, "[Server Success] Manager initialize : pid(%d)", pid);
 +      SLOG(LOG_ERROR, TAG_VCD, "[Server Success] Manager initialize : pid(%d)", pid);
  
        return VCD_ERROR_NONE;
  }
@@@ -1357,7 -1354,7 +1357,7 @@@ int vcd_server_mgr_finalize(int pid
                ecore_timer_add(0, __finalize_quit_ecore_loop, NULL);
        }
  
 -      SLOG(LOG_DEBUG, TAG_VCD, "[Server Success] Manager Finalize : pid(%d)", pid);
 +      SLOG(LOG_ERROR, TAG_VCD, "[Server Success] Manager Finalize : pid(%d)", pid);
  
        return VCD_ERROR_NONE;
  }
@@@ -1468,6 -1465,7 +1468,7 @@@ int vcd_server_mgr_set_client_info(int 
  static int __start_internal_recognition()
  {
        int ret;
+       vcd_client_widget_set_waiting_for_recording(-1, false);
  
        if (0 != vcd_client_command_collect_command()) {
                SLOG(LOG_ERROR, TAG_VCD, "[Client Data ERROR] Fail to collect command");
                return VCD_ERROR_OPERATION_FAILED;
        }
  
 -      SLOG(LOG_DEBUG, TAG_VCD, "[Server Success] Set command");
 +      SLOG(LOG_ERROR, TAG_VCD, "[Server Success] Set command");
  
        bool stop_by_silence = true;
        if (VCD_RECOGNITION_MODE_MANUAL == vcd_client_get_recognition_mode()) {
                return VCD_ERROR_OPERATION_FAILED;
        }
  
 -      SLOG(LOG_DEBUG, TAG_VCD, "[Server Success] Start engine");
 +      SLOG(LOG_ERROR, TAG_VCD, "[Server Success] Start engine");
  
  #if 1
        /* 5. recorder start */
        vcd_config_set_service_state(VCD_STATE_RECORDING);
        vcdc_send_service_state(VCD_STATE_RECORDING);
  
 -      SLOG(LOG_DEBUG, TAG_VCD, "[Server Success] Start recognition(%d)", stop_by_silence);
 +      SLOG(LOG_ERROR, TAG_VCD, "[Server Success] Start recognition(%d)", stop_by_silence);
  
        return 0;
  }
@@@ -1537,7 -1535,7 +1538,7 @@@ static Eina_Bool __vcd_request_show_too
  {
        int pid = vcd_client_widget_get_foreground_pid();
        if (-1 != pid) {
 -              SLOG(LOG_DEBUG, TAG_VCD, "[Server] Request tooltip show and widget command");
 +              SLOG(LOG_ERROR, TAG_VCD, "[Server] Request tooltip show and widget command, show(%d)", (bool)data);
                vcdc_send_show_tooltip(pid, (bool)data);
        }
  
@@@ -1559,7 -1557,7 +1560,7 @@@ int vcd_server_mgr_start(vcd_recognitio
        }
        vcd_client_widget_set_waiting_for_recording(-1, false);
  
 -      SLOG(LOG_DEBUG, TAG_VCD, "[Server] set recognition mode = %d", recognition_mode);
 +      SLOG(LOG_ERROR, TAG_VCD, "[Server] set recognition mode = %d", recognition_mode);
        vcd_client_set_recognition_mode(recognition_mode);
  
        if (false == exclusive_cmd) {
                if (1 == vcd_config_get_command_type_enabled(VC_COMMAND_TYPE_WIDGET)) {
                        int pid = vcd_client_widget_get_foreground_pid();
                        if (-1 != pid) {
 -                              SLOG(LOG_INFO, TAG_VCD, "[Server] Request tooltip show and widget command");
 +                              SLOG(LOG_ERROR, TAG_VCD, "[Server] Request tooltip show and widget command");
                                ecore_timer_add(0, __vcd_request_show_tooltip, (void*)true);
                                vcd_client_widget_set_waiting_for_recording(pid, true);
                                return 0;
                }
        }
  
 +      SLOG(LOG_ERROR, TAG_VCD, "[Server] start internal recognition");
 +
        int ret = __start_internal_recognition();
        if (0 != ret) {
                SLOG(LOG_ERROR, TAG_VCD, "[Server ERROR] Fail to start recongition : %d", ret);
                vcd_client_unset_exclusive_command(fg_pid);
        }
  
 +      SLOG(LOG_ERROR, TAG_VCD, "[Server Success] start internal recognition");
        return VCD_ERROR_NONE;
  }
  
@@@ -1618,7 -1613,6 +1619,7 @@@ int vcd_server_mgr_stop(
                SLOG(LOG_DEBUG, TAG_VCD, "[Server] Manager is NOT available.");
                return VCD_ERROR_OPERATION_FAILED;
        }
 +      SLOG(LOG_ERROR, TAG_VCD, "[Server] stop internal recognition");
  
  #if 1
        /* 2. Stop recorder */
        vcd_config_set_service_state(VCD_STATE_PROCESSING);
        vcdc_send_service_state(VCD_STATE_PROCESSING);
  
 +      SLOG(LOG_ERROR, TAG_VCD, "[Server Success] stop internal recognition");
        return VCD_ERROR_NONE;
  }
  
@@@ -1671,7 -1664,6 +1672,7 @@@ int vcd_server_mgr_cancel(
                vcdc_send_service_state(VCD_STATE_READY);
                return VCD_ERROR_NONE;
        }
 +      SLOG(LOG_ERROR, TAG_VCD, "[Server] cancel internal recognition");
  
  #if 1
        /* 2. Stop recorder */
        vcd_config_set_service_state(VCD_STATE_READY);
        vcdc_send_service_state(VCD_STATE_READY);
  
 +      SLOG(LOG_ERROR, TAG_VCD, "[Server Success] cancel internal recognition");
        return VCD_ERROR_NONE;
  }
  
@@@ -1841,7 -1832,7 +1842,7 @@@ int vcd_server_mgr_enable_command_type(
        if (0 != ret) {
                SLOG(LOG_ERROR, TAG_VCD, "[Server ERROR] Fail to enable command type");
        } else {
 -              SLOG(LOG_DEBUG, TAG_VCD, "[Server] Enable command type(%d)", cmd_type);
 +              SLOG(LOG_ERROR, TAG_VCD, "[Server] Enable command type(%d)", cmd_type);
        }
  
        return ret;
@@@ -1867,7 -1858,7 +1868,7 @@@ int vcd_server_mgr_disable_command_type
        if (0 != ret) {
                SLOG(LOG_ERROR, TAG_VCD, "[Server ERROR] Fail to disable command type");
        } else {
 -              SLOG(LOG_DEBUG, TAG_VCD, "[Server] Disable command type(%d)", cmd_type);
 +              SLOG(LOG_ERROR, TAG_VCD, "[Server] Disable command type(%d)", cmd_type);
        }
  
        return ret;
@@@ -2260,7 -2251,6 +2261,7 @@@ int vcd_server_widget_start_recording(i
                SLOG(LOG_WARN, TAG_VCD, "[Server] widget command is NOT available");
        }
  
 +      SLOG(LOG_ERROR, TAG_VCD, "[Server] start internal recongition : %d", widget_command);
        int ret = __start_internal_recognition();
        if (0 != ret) {
                SLOG(LOG_ERROR, TAG_VCD, "[Server ERROR] Fail to start recongition : %d", ret);