summaryrefslogtreecommitdiff
path: root/src/components/application_manager/src/commands/mobile/perform_audio_pass_thru_request.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/application_manager/src/commands/mobile/perform_audio_pass_thru_request.cc')
-rw-r--r--src/components/application_manager/src/commands/mobile/perform_audio_pass_thru_request.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/components/application_manager/src/commands/mobile/perform_audio_pass_thru_request.cc b/src/components/application_manager/src/commands/mobile/perform_audio_pass_thru_request.cc
index 9f5fd937f9..813be62938 100644
--- a/src/components/application_manager/src/commands/mobile/perform_audio_pass_thru_request.cc
+++ b/src/components/application_manager/src/commands/mobile/perform_audio_pass_thru_request.cc
@@ -47,8 +47,6 @@ namespace str = strings;
PerformAudioPassThruRequest::PerformAudioPassThruRequest(
const MessageSharedPtr& message, ApplicationManager& application_manager)
: CommandRequestImpl(message, application_manager)
- , awaiting_tts_speak_response_(false)
- , awaiting_ui_response_(false)
, result_tts_speak_(hmi_apis::Common_Result::INVALID_ENUM)
, result_ui_(hmi_apis::Common_Result::INVALID_ENUM) {
subscribe_on_event(hmi_apis::FunctionID::TTS_OnResetTimeout);
@@ -97,7 +95,7 @@ void PerformAudioPassThruRequest::Run() {
// According with new implementation processing of UNSUPPORTE_RESOURCE
// need set flag before sending to hmi
- awaiting_ui_response_ = true;
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
if ((*message_)[str::msg_params].keyExists(str::initial_prompt) &&
(0 < (*message_)[str::msg_params][str::initial_prompt].length())) {
// In case TTS Speak, subscribe on notification
@@ -119,7 +117,7 @@ void PerformAudioPassThruRequest::on_event(const event_engine::Event& event) {
switch (event.id()) {
case hmi_apis::FunctionID::UI_PerformAudioPassThru: {
LOG4CXX_TRACE(logger_, "Received UI_PerformAudioPassThru");
- awaiting_ui_response_ = false;
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
result_ui_ = static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asUInt());
@@ -142,7 +140,7 @@ void PerformAudioPassThruRequest::on_event(const event_engine::Event& event) {
result_tts_speak_ = static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asUInt());
GetInfo(message, tts_info_);
- awaiting_tts_speak_response_ = false;
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
const bool is_tts_speak_success_unsuported =
Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
result_tts_speak_,
@@ -229,7 +227,7 @@ void PerformAudioPassThruRequest::SendSpeakRequest() {
// app_id
msg_params[strings::app_id] = connection_key();
msg_params[hmi_request::speak_type] = Common_MethodName::AUDIO_PASS_THRU;
- awaiting_tts_speak_response_ = true;
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
SendHMIRequest(FunctionID::TTS_Speak, &msg_params, true);
}
@@ -273,6 +271,7 @@ void PerformAudioPassThruRequest::SendPerformAudioPassThruRequest() {
msg_params[str::mute_audio] = true;
}
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
SendHMIRequest(
hmi_apis::FunctionID::UI_PerformAudioPassThru, &msg_params, true);
}
@@ -353,7 +352,7 @@ void PerformAudioPassThruRequest::FinishTTSSpeak() {
LOG4CXX_DEBUG(logger_, "Stop AudioPassThru.");
application_manager_.StopAudioPassThru(connection_key());
}
- if (!awaiting_tts_speak_response_) {
+ if (!IsInterfaceAwaited(HmiInterfaces::HMI_INTERFACE_TTS)) {
LOG4CXX_WARN(logger_, "TTS Speak is inactive.");
return;
}
@@ -362,7 +361,8 @@ void PerformAudioPassThruRequest::FinishTTSSpeak() {
bool PerformAudioPassThruRequest::IsWaitingHMIResponse() {
LOG4CXX_AUTO_TRACE(logger_);
- return awaiting_tts_speak_response_ || awaiting_ui_response_;
+ return IsInterfaceAwaited(HmiInterfaces::HMI_INTERFACE_TTS) ||
+ IsInterfaceAwaited(HmiInterfaces::HMI_INTERFACE_UI);
}
} // namespace commands