vc_info_parser_unset_result(vcd_client_manager_get_exclusive());
vcd_client_manager_set_result_text(all_result);
- SLOG(LOG_INFO, TAG_VCD, "[Server] Event(%d), Text(%s) Nonfixed(%s) Msg(%s) Result count(%d)",
+ 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);
if (VCD_RECOGNITION_MODE_RESTART_AFTER_REJECT == vcd_client_get_recognition_mode()) {
}
}
#if 1
-
- int pid = vcd_client_widget_get_foreground_pid();
- if (-1 != pid) {
- if (NULL != all_result) {
- bool enable = false;
- vcd_client_widget_get_asr_result_enabled(pid, &enable);
- if (true == enable) {
- SLOG(LOG_DEBUG, TAG_VCD, "[Server] Send ASR result to Widget client");
- bool is_consumed = false;
- if (NULL != user_info) {
- *user_info = 0x00;
- }
- if (0 != vcdc_send_asr_result(pid, event, all_result, VC_COMMAND_TYPE_WIDGET, &is_consumed)) {
- SLOG(LOG_ERROR, TAG_VCD, "[Server ERROR] Fail to send asr result");
- } else {
- SLOG(LOG_DEBUG, TAG_VCD, "[Server] ASR result is consumed(%d)", is_consumed);
- 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);
- }
- vcdc_send_show_tooltip(pid, false);
- if (-1 != vcd_client_manager_get_pid()) {
- /* Manager client is available */
- vc_info_parser_unset_result(false);
- vc_info_parser_set_result(all_result, VC_RESULT_EVENT_RESULT_SUCCESS, msg, NULL, false);
- if (0 != vcdc_send_result_to_manager(vcd_client_manager_get_pid(), VC_RESULT_TYPE_NOTIFICATION)) {
- SLOG(LOG_WARN, TAG_VCD, "[Server WARNING] Fail to send result");
- }
- }
-
- vcd_client_manager_set_exclusive(false);
-
- vcd_config_set_service_state(VCD_STATE_READY);
- vcdc_send_service_state(VCD_STATE_READY);
- return VCD_ERROR_NONE;
- }
- }
- }
- }
- }
-
/* if nlu_result is exist, Add command handle(is_action) into result list */
/* Normal result */
SLOG(LOG_DEBUG, TAG_VCD, "[Server] @ Get engine result @");
}
/* priority filter */
- /* system > exclusive > foreground = widget > system_background > background */
+ /* system > exclusive > widget > foreground > system_background > background */
int i = 0;
int* filtered_id = (int*)calloc(count, sizeof(int));
if (!filtered_id) {
}
}
+ // ASR consume
+ if (top_priority >= VC_COMMAND_PRIORITY_WIDGET) {
+ int pid = vcd_client_widget_get_foreground_pid();
+ if (-1 != pid) {
+ if (NULL != all_result) {
+ vc_info_parser_set_result(all_result, event, msg, NULL, false);
+ bool enable = false;
+ vcd_client_widget_get_asr_result_enabled(pid, &enable);
+ if (true == enable) {
+ SLOG(LOG_DEBUG, TAG_VCD, "[Server] Send ASR result to Widget client");
+ bool is_consumed = false;
+ if (NULL != user_info) {
+ *user_info = 0x00;
+ }
+ if (0 != vcdc_send_asr_result(pid, event, all_result, VC_COMMAND_TYPE_WIDGET, &is_consumed)) {
+ SLOG(LOG_ERROR, TAG_VCD, "[Server ERROR] Fail to send asr result");
+ } else {
+ SLOG(LOG_DEBUG, TAG_VCD, "[Server] ASR result is consumed(%d)", is_consumed);
+ 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);
+ }
+ vcdc_send_show_tooltip(pid, false);
+ if (-1 != vcd_client_manager_get_pid()) {
+ /* Manager client is available */
+ vc_info_parser_unset_result(false);
+ vc_info_parser_set_result(all_result, VC_RESULT_EVENT_RESULT_SUCCESS, msg, NULL, false);
+ if (0 != vcdc_send_result_to_manager(vcd_client_manager_get_pid(), VC_RESULT_TYPE_NOTIFICATION)) {
+ SLOG(LOG_WARN, TAG_VCD, "[Server WARNING] Fail to send result");
+ }
+ }
+
+ vcd_client_manager_set_exclusive(false);
+
+ vcd_config_set_service_state(VCD_STATE_READY);
+ vcdc_send_service_state(VCD_STATE_READY);
+ vc_cmd_list_destroy(vc_cmd_list, true);
+ if (NULL != filtered_id) {
+ free(filtered_id);
+ filtered_id = NULL;
+ }
+ return VCD_ERROR_NONE;
+ }
+ }
+ }
+ }
+ }
+ }
+
int is_action = 0;
for (i = 0; i < filtered_count; i++) {
SLOG(LOG_INFO, TAG_VCD, "[Server] [%d] Filtered Result id(%d)", i, filtered_id[i]);