diff options
37 files changed, 184 insertions, 31 deletions
diff --git a/src/components/application_manager/include/application_manager/commands/command_request_impl.h b/src/components/application_manager/include/application_manager/commands/command_request_impl.h index 614f86a6f1..3603eacb04 100644 --- a/src/components/application_manager/include/application_manager/commands/command_request_impl.h +++ b/src/components/application_manager/include/application_manager/commands/command_request_impl.h @@ -297,6 +297,35 @@ class CommandRequestImpl : public CommandImpl, */ const CommandParametersPermissions& parameters_permissions() const; + /** + * @brief Adds interface to be awaited for by sdl request command + @param interface_id interface which SDL expects to response in given time + */ + void StartAwaitForInterface(const HmiInterfaces::InterfaceID interface_id); + + /** + * @brief Gets interface await state. + * @param interface_id interface which SDL awaits for response in given time + * @return true if SDL awaits for response from given interface in + * interface_id + */ + bool IsInterfaceAwaited(const HmiInterfaces::InterfaceID& interface_id) const; + + /** + * @brief Sets given HMI interface await status to false + * @param interface_id interface which SDL no longer awaits for response in + * given time + */ + void EndAwaitForInterface(const HmiInterfaces::InterfaceID& interface_id); + + /** + * @brief This set stores all the interfaces which are awaited by SDL to + * return a response on some request + */ + std::set<HmiInterfaces::InterfaceID> awaiting_response_interfaces_; + + mutable sync_primitives::Lock awaiting_response_interfaces_lock_; + RequestState current_state_; sync_primitives::Lock state_lock_; CommandParametersPermissions parameters_permissions_; diff --git a/src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_request.h b/src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_request.h index eb955df197..c16a014c9f 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_request.h @@ -131,12 +131,6 @@ class ResetGlobalPropertiesRequest : public CommandRequestImpl { DISALLOW_COPY_AND_ASSIGN(ResetGlobalPropertiesRequest); - bool is_ui_send_; - bool is_tts_send_; - - bool is_ui_received_; - bool is_tts_received_; - hmi_apis::Common_Result::eType ui_result_; hmi_apis::Common_Result::eType tts_result_; std::string ui_response_info_; diff --git a/src/components/application_manager/src/commands/command_request_impl.cc b/src/components/application_manager/src/commands/command_request_impl.cc index f461db814d..020cfa5ab1 100644 --- a/src/components/application_manager/src/commands/command_request_impl.cc +++ b/src/components/application_manager/src/commands/command_request_impl.cc @@ -879,6 +879,67 @@ const CommandParametersPermissions& CommandRequestImpl::parameters_permissions() return parameters_permissions_; } +void CommandRequestImpl::StartAwaitForInterface( + const HmiInterfaces::InterfaceID interface_id) { + sync_primitives::AutoLock lock(awaiting_response_interfaces_lock_); + awaiting_response_interfaces_.insert(interface_id); +} + +bool CommandRequestImpl::IsInterfaceAwaited( + const HmiInterfaces::InterfaceID& interface_id) const { + sync_primitives::AutoLock lock(awaiting_response_interfaces_lock_); + std::set<HmiInterfaces::InterfaceID>::const_iterator it = + awaiting_response_interfaces_.find(interface_id); + return (it != awaiting_response_interfaces_.end()); +} + +void CommandRequestImpl::EndAwaitForInterface( + const HmiInterfaces::InterfaceID& interface_id) { + sync_primitives::AutoLock lock(awaiting_response_interfaces_lock_); + std::set<HmiInterfaces::InterfaceID>::const_iterator it = + awaiting_response_interfaces_.find(interface_id); + if (it != awaiting_response_interfaces_.end()) { + awaiting_response_interfaces_.erase(it); + } else { + LOG4CXX_WARN(logger_, + "EndAwaitForInterface called on interface \ + which was not put into await state: " + << interface_id); + } +} + +bool CommandRequestImpl::IsResultCodeUnsupported( + const ResponseInfo& first, const ResponseInfo& second) const { + const bool first_ok_second_unsupported = + (first.is_ok || first.is_not_used) && second.is_unsupported_resource; + const bool both_unsupported = + first.is_unsupported_resource && second.is_unsupported_resource; + return first_ok_second_unsupported || both_unsupported; +} + +std::string GetComponentNameFromInterface( + const HmiInterfaces::InterfaceID& interface) { + switch (interface) { + case HmiInterfaces::HMI_INTERFACE_Buttons: + return "Buttons"; + case HmiInterfaces::HMI_INTERFACE_BasicCommunication: + return "BasicCommunication"; + case HmiInterfaces::HMI_INTERFACE_VR: + return "VR"; + case HmiInterfaces::HMI_INTERFACE_TTS: + return "TTS"; + case HmiInterfaces::HMI_INTERFACE_UI: + return "UI"; + case HmiInterfaces::HMI_INTERFACE_Navigation: + return "Navigation"; + case HmiInterfaces::HMI_INTERFACE_VehicleInfo: + return "VehicleInfo"; + case HmiInterfaces::HMI_INTERFACE_SDL: + return "SDL"; + default: + return "Unknown type"; + } +} } // namespace commands } // namespace application_manager diff --git a/src/components/application_manager/src/commands/mobile/add_command_request.cc b/src/components/application_manager/src/commands/mobile/add_command_request.cc index c748ddcbb6..69948b8122 100644 --- a/src/components/application_manager/src/commands/mobile/add_command_request.cc +++ b/src/components/application_manager/src/commands/mobile/add_command_request.cc @@ -192,10 +192,12 @@ void AddCommandRequest::Run() { } if (send_ui_) { + StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); SendHMIRequest(hmi_apis::FunctionID::UI_AddCommand, &ui_msg_params, true); } if (send_vr_) { + StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR); SendHMIRequest(hmi_apis::FunctionID::VR_AddCommand, &vr_msg_params, true); } } @@ -317,6 +319,7 @@ void AddCommandRequest::on_event(const event_engine::Event& event) { switch (event.id()) { case hmi_apis::FunctionID::UI_AddCommand: { LOG4CXX_INFO(logger_, "Received UI_AddCommand event"); + EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); is_ui_received_ = true; ui_result_ = static_cast<hmi_apis::Common_Result::eType>( message[strings::params][hmi_response::code].asInt()); @@ -328,6 +331,7 @@ void AddCommandRequest::on_event(const event_engine::Event& event) { } case hmi_apis::FunctionID::VR_AddCommand: { LOG4CXX_INFO(logger_, "Received VR_AddCommand event"); + EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR); is_vr_received_ = true; vr_result_ = static_cast<hmi_apis::Common_Result::eType>( message[strings::params][hmi_response::code].asInt()); diff --git a/src/components/application_manager/src/commands/mobile/add_sub_menu_request.cc b/src/components/application_manager/src/commands/mobile/add_sub_menu_request.cc index a5491481dc..fe44e5a41f 100644 --- a/src/components/application_manager/src/commands/mobile/add_sub_menu_request.cc +++ b/src/components/application_manager/src/commands/mobile/add_sub_menu_request.cc @@ -94,6 +94,7 @@ void AddSubMenuRequest::Run() { (*message_)[strings::msg_params][strings::menu_name]; msg_params[strings::app_id] = app->app_id(); + StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); SendHMIRequest(hmi_apis::FunctionID::UI_AddSubMenu, &msg_params, true); } @@ -103,6 +104,7 @@ void AddSubMenuRequest::on_event(const event_engine::Event& event) { switch (event.id()) { case hmi_apis::FunctionID::UI_AddSubMenu: { + EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); hmi_apis::Common_Result::eType result_code = static_cast<hmi_apis::Common_Result::eType>( message[strings::params][hmi_response::code].asInt()); diff --git a/src/components/application_manager/src/commands/mobile/alert_maneuver_request.cc b/src/components/application_manager/src/commands/mobile/alert_maneuver_request.cc index 78b05e452f..cf06bbfc53 100644 --- a/src/components/application_manager/src/commands/mobile/alert_maneuver_request.cc +++ b/src/components/application_manager/src/commands/mobile/alert_maneuver_request.cc @@ -111,6 +111,7 @@ void AlertManeuverRequest::Run() { } pending_requests_.Add(hmi_apis::FunctionID::Navigation_AlertManeuver); + StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation); SendHMIRequest( hmi_apis::FunctionID::Navigation_AlertManeuver, &msg_params, true); @@ -123,6 +124,7 @@ void AlertManeuverRequest::Run() { msg_params[hmi_request::speak_type] = hmi_apis::Common_MethodName::ALERT_MANEUVER; + StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS); SendHMIRequest(hmi_apis::FunctionID::TTS_Speak, &msg_params, true); } } @@ -134,6 +136,7 @@ void AlertManeuverRequest::on_event(const event_engine::Event& event) { switch (event_id) { case hmi_apis::FunctionID::Navigation_AlertManeuver: { LOG4CXX_INFO(logger_, "Received Navigation_AlertManeuver event"); + EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation); pending_requests_.Remove(event_id); navi_alert_maneuver_result_code_ = static_cast<hmi_apis::Common_Result::eType>( @@ -143,6 +146,7 @@ void AlertManeuverRequest::on_event(const event_engine::Event& event) { } case hmi_apis::FunctionID::TTS_Speak: { LOG4CXX_INFO(logger_, "Received TTS_Speak event"); + EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS); pending_requests_.Remove(event_id); tts_speak_result_code_ = static_cast<hmi_apis::Common_Result::eType>( message[strings::params][hmi_response::code].asInt()); @@ -243,7 +247,8 @@ bool AlertManeuverRequest::IsWhiteSpaceExist() { SmartArray::const_iterator it_soft_button = soft_button_array->begin(); for (; it_soft_button != soft_button_array->end(); ++it_soft_button) { - const char* soft_button_text = (*it_soft_button)[strings::text].asCharArray(); + const char* soft_button_text = + (*it_soft_button)[strings::text].asCharArray(); if (!CheckSyntax(soft_button_text)) { LOG4CXX_ERROR(logger_, "Invalid soft_buttons syntax check failed"); return true; diff --git a/src/components/application_manager/src/commands/mobile/alert_request.cc b/src/components/application_manager/src/commands/mobile/alert_request.cc index 53515a810a..67b34931c3 100644 --- a/src/components/application_manager/src/commands/mobile/alert_request.cc +++ b/src/components/application_manager/src/commands/mobile/alert_request.cc @@ -148,6 +148,7 @@ void AlertRequest::on_event(const event_engine::Event& event) { case hmi_apis::FunctionID::UI_Alert: { LOG4CXX_INFO(logger_, "Received UI_Alert event"); // Unsubscribe from event to avoid unwanted messages + EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); unsubscribe_from_event(hmi_apis::FunctionID::UI_Alert); awaiting_ui_alert_response_ = false; HmiInterfaces::InterfaceState ui_interface_state = @@ -157,6 +158,7 @@ void AlertRequest::on_event(const event_engine::Event& event) { if (awaiting_tts_speak_response_ && HmiInterfaces::STATE_NOT_AVAILABLE != ui_interface_state) { awaiting_tts_stop_speaking_response_ = true; + StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS); SendHMIRequest(hmi_apis::FunctionID::TTS_StopSpeaking, NULL, true); } alert_result_ = static_cast<hmi_apis::Common_Result::eType>( @@ -170,6 +172,7 @@ void AlertRequest::on_event(const event_engine::Event& event) { case hmi_apis::FunctionID::TTS_Speak: { LOG4CXX_INFO(logger_, "Received TTS_Speak event"); // Unsubscribe from event to avoid unwanted messages + EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS); unsubscribe_from_event(hmi_apis::FunctionID::TTS_Speak); awaiting_tts_speak_response_ = false; tts_speak_result_ = static_cast<hmi_apis::Common_Result::eType>( @@ -179,6 +182,7 @@ void AlertRequest::on_event(const event_engine::Event& event) { } case hmi_apis::FunctionID::TTS_StopSpeaking: { LOG4CXX_INFO(logger_, "Received TTS_StopSpeaking event"); + EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS); // Unsubscribe from event to avoid unwanted messages unsubscribe_from_event(hmi_apis::FunctionID::TTS_StopSpeaking); awaiting_tts_stop_speaking_response_ = false; @@ -350,6 +354,7 @@ void AlertRequest::SendAlertRequest(int32_t app_id) { msg_params.keyExists(hmi_request::soft_buttons)) { awaiting_ui_alert_response_ = true; is_ui_alert_sent_ = true; + StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); SendHMIRequest(hmi_apis::FunctionID::UI_Alert, &msg_params, true); } } @@ -374,6 +379,7 @@ void AlertRequest::SendSpeakRequest(int32_t app_id, } msg_params[strings::app_id] = app_id; msg_params[hmi_request::speak_type] = Common_MethodName::ALERT; + StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS); SendHMIRequest(FunctionID::TTS_Speak, &msg_params, true); } diff --git a/src/components/application_manager/src/commands/mobile/create_interaction_choice_set_request.cc b/src/components/application_manager/src/commands/mobile/create_interaction_choice_set_request.cc index e1148bd126..94b40b2606 100644 --- a/src/components/application_manager/src/commands/mobile/create_interaction_choice_set_request.cc +++ b/src/components/application_manager/src/commands/mobile/create_interaction_choice_set_request.cc @@ -287,6 +287,7 @@ void CreateInteractionChoiceSetRequest::SendVRAddCommandRequests( sync_primitives::AutoLock commands_lock(vr_commands_lock_); const uint32_t vr_cmd_id = msg_params[strings::cmd_id].asUInt(); + StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR); const uint32_t vr_corr_id = SendHMIRequest(hmi_apis::FunctionID::VR_AddCommand, &msg_params, true); @@ -356,6 +357,7 @@ void CreateInteractionChoiceSetRequest::on_event( uint32_t corr_id = static_cast<uint32_t>( message[strings::params][strings::correlation_id].asUInt()); if (event.id() == hmi_apis::FunctionID::VR_AddCommand) { + EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR); { sync_primitives::AutoLock commands_lock(vr_commands_lock_); if (is_no_error) { diff --git a/src/components/application_manager/src/commands/mobile/delete_command_request.cc b/src/components/application_manager/src/commands/mobile/delete_command_request.cc index cfc8e12144..2621088bc1 100644 --- a/src/components/application_manager/src/commands/mobile/delete_command_request.cc +++ b/src/components/application_manager/src/commands/mobile/delete_command_request.cc @@ -104,12 +104,14 @@ void DeleteCommandRequest::Run() { is_vr_send_ = true; } if (is_ui_send_) { + StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); SendHMIRequest(hmi_apis::FunctionID::UI_DeleteCommand, &msg_params, true); } if (is_vr_send_) { // VR params msg_params[strings::grammar_id] = application->get_grammar_id(); msg_params[strings::type] = hmi_apis::Common_VRCommandType::Command; + StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR); SendHMIRequest(hmi_apis::FunctionID::VR_DeleteCommand, &msg_params, true); } } @@ -143,6 +145,7 @@ void DeleteCommandRequest::on_event(const event_engine::Event& event) { const smart_objects::SmartObject& message = event.smart_object(); switch (event.id()) { case hmi_apis::FunctionID::UI_DeleteCommand: { + EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); is_ui_received_ = true; ui_result_ = static_cast<hmi_apis::Common_Result::eType>( message[strings::params][hmi_response::code].asInt()); @@ -153,6 +156,7 @@ void DeleteCommandRequest::on_event(const event_engine::Event& event) { break; } case hmi_apis::FunctionID::VR_DeleteCommand: { + EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR); is_vr_received_ = true; vr_result_ = static_cast<hmi_apis::Common_Result::eType>( message[strings::params][hmi_response::code].asInt()); diff --git a/src/components/application_manager/src/commands/mobile/delete_sub_menu_request.cc b/src/components/application_manager/src/commands/mobile/delete_sub_menu_request.cc index 21c7ecce90..09f3139245 100644 --- a/src/components/application_manager/src/commands/mobile/delete_sub_menu_request.cc +++ b/src/components/application_manager/src/commands/mobile/delete_sub_menu_request.cc @@ -74,6 +74,7 @@ void DeleteSubMenuRequest::Run() { msg_params[strings::menu_id] = (*message_)[strings::msg_params][strings::menu_id]; msg_params[strings::app_id] = app->app_id(); + StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); SendHMIRequest(hmi_apis::FunctionID::UI_DeleteSubMenu, &msg_params, true); } @@ -143,6 +144,7 @@ void DeleteSubMenuRequest::on_event(const event_engine::Event& event) { switch (event.id()) { case hmi_apis::FunctionID::UI_DeleteSubMenu: { + EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); hmi_apis::Common_Result::eType result_code = static_cast<hmi_apis::Common_Result::eType>( message[strings::params][hmi_response::code].asInt()); diff --git a/src/components/application_manager/src/commands/mobile/diagnostic_message_request.cc b/src/components/application_manager/src/commands/mobile/diagnostic_message_request.cc index 5c5d250026..7704d700f9 100644 --- a/src/components/application_manager/src/commands/mobile/diagnostic_message_request.cc +++ b/src/components/application_manager/src/commands/mobile/diagnostic_message_request.cc @@ -83,6 +83,7 @@ void DiagnosticMessageRequest::Run() { // Add app_id for HMI request (*message_)[strings::msg_params][strings::app_id] = app->app_id(); + StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo); SendHMIRequest(hmi_apis::FunctionID::VehicleInfo_DiagnosticMessage, &(*message_)[strings::msg_params], true); @@ -94,6 +95,7 @@ void DiagnosticMessageRequest::on_event(const event_engine::Event& event) { switch (event.id()) { case hmi_apis::FunctionID::VehicleInfo_DiagnosticMessage: { + EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo); hmi_apis::Common_Result::eType result_code = static_cast<hmi_apis::Common_Result::eType>( message[strings::params][hmi_response::code].asInt()); diff --git a/src/components/application_manager/src/commands/mobile/dial_number_request.cc b/src/components/application_manager/src/commands/mobile/dial_number_request.cc index 64685afe2e..d0ab42e266 100644 --- a/src/components/application_manager/src/commands/mobile/dial_number_request.cc +++ b/src/components/application_manager/src/commands/mobile/dial_number_request.cc @@ -87,6 +87,7 @@ void DialNumberRequest::Run() { (*message_)[strings::msg_params][strings::number].asString(); msg_params[strings::app_id] = application->hmi_app_id(); + StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_BasicCommunication); SendHMIRequest( hmi_apis::FunctionID::BasicCommunication_DialNumber, &msg_params, true); } @@ -106,6 +107,7 @@ void DialNumberRequest::on_event(const event_engine::Event& event) { switch (event.id()) { case hmi_apis::FunctionID::BasicCommunication_DialNumber: { LOG4CXX_INFO(logger_, "Received DialNumber event"); + EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_BasicCommunication); result_code = CommandRequestImpl::GetMobileResultCode( static_cast<hmi_apis::Common_Result::eType>( message[strings::params][hmi_response::code].asInt())); diff --git a/src/components/application_manager/src/commands/mobile/end_audio_pass_thru_request.cc b/src/components/application_manager/src/commands/mobile/end_audio_pass_thru_request.cc index f67d1f2434..0bd83078e5 100644 --- a/src/components/application_manager/src/commands/mobile/end_audio_pass_thru_request.cc +++ b/src/components/application_manager/src/commands/mobile/end_audio_pass_thru_request.cc @@ -47,6 +47,7 @@ EndAudioPassThruRequest::~EndAudioPassThruRequest() {} void EndAudioPassThruRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); + StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); SendHMIRequest(hmi_apis::FunctionID::UI_EndAudioPassThru, NULL, true); } @@ -56,6 +57,7 @@ void EndAudioPassThruRequest::on_event(const event_engine::Event& event) { switch (event.id()) { case hmi_apis::FunctionID::UI_EndAudioPassThru: { + EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); hmi_apis::Common_Result::eType result_code = static_cast<hmi_apis::Common_Result::eType>( message[strings::params][hmi_response::code].asUInt()); diff --git a/src/components/application_manager/src/commands/mobile/get_dtcs_request.cc b/src/components/application_manager/src/commands/mobile/get_dtcs_request.cc index d98207c772..88fd07234a 100644 --- a/src/components/application_manager/src/commands/mobile/get_dtcs_request.cc +++ b/src/components/application_manager/src/commands/mobile/get_dtcs_request.cc @@ -72,6 +72,7 @@ void GetDTCsRequest::Run() { msg_params[strings::app_id] = app->app_id(); + StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo); SendHMIRequest(hmi_apis::FunctionID::VehicleInfo_GetDTCs, &msg_params, true); } @@ -81,6 +82,7 @@ void GetDTCsRequest::on_event(const event_engine::Event& event) { switch (event.id()) { case hmi_apis::FunctionID::VehicleInfo_GetDTCs: { + EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo); hmi_apis::Common_Result::eType result_code = static_cast<hmi_apis::Common_Result::eType>( message[strings::params][hmi_response::code].asInt()); diff --git a/src/components/application_manager/src/commands/mobile/get_vehicle_data_request.cc b/src/components/application_manager/src/commands/mobile/get_vehicle_data_request.cc index 25e2da3eb6..84c6e0ba7c 100644 --- a/src/components/application_manager/src/commands/mobile/get_vehicle_data_request.cc +++ b/src/components/application_manager/src/commands/mobile/get_vehicle_data_request.cc @@ -250,6 +250,7 @@ void GetVehicleDataRequest::Run() { } } if (msg_params.length() > min_length_msg_params) { + StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo); SendHMIRequest( hmi_apis::FunctionID::VehicleInfo_GetVehicleData, &msg_params, true); return; @@ -266,6 +267,7 @@ void GetVehicleDataRequest::on_event(const event_engine::Event& event) { switch (event.id()) { case hmi_apis::FunctionID::VehicleInfo_GetVehicleData: { + EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo); hmi_apis::Common_Result::eType result_code = static_cast<hmi_apis::Common_Result::eType>( message[strings::params][hmi_response::code].asInt()); diff --git a/src/components/application_manager/src/commands/mobile/get_way_points_request.cc b/src/components/application_manager/src/commands/mobile/get_way_points_request.cc index c313d74d4b..da4ce38646 100644 --- a/src/components/application_manager/src/commands/mobile/get_way_points_request.cc +++ b/src/components/application_manager/src/commands/mobile/get_way_points_request.cc @@ -31,6 +31,7 @@ void GetWayPointsRequest::Run() { msg_params = (*message_)[strings::msg_params]; msg_params[strings::app_id] = app->app_id(); + StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation); SendHMIRequest(hmi_apis::FunctionID::Navigation_GetWayPoints, msg_params.empty() ? NULL : &msg_params, true); @@ -48,6 +49,7 @@ void GetWayPointsRequest::on_event(const event_engine::Event& event) { } case hmi_apis::FunctionID::Navigation_GetWayPoints: { LOG4CXX_INFO(logger_, "Received Navigation_GetWayPoints event"); + EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation); const hmi_apis::Common_Result::eType result_code = static_cast<hmi_apis::Common_Result::eType>( message[strings::params][hmi_response::code].asInt()); 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 diff --git a/src/components/application_manager/src/commands/mobile/perform_interaction_request.cc b/src/components/application_manager/src/commands/mobile/perform_interaction_request.cc index b199e652a6..7e26658c6c 100644 --- a/src/components/application_manager/src/commands/mobile/perform_interaction_request.cc +++ b/src/components/application_manager/src/commands/mobile/perform_interaction_request.cc @@ -226,6 +226,7 @@ void PerformInteractionRequest::on_event(const event_engine::Event& event) { } case hmi_apis::FunctionID::UI_PerformInteraction: { LOG4CXX_DEBUG(logger_, "Received UI_PerformInteraction event"); + EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); ui_response_received_ = true; unsubscribe_from_event(hmi_apis::FunctionID::UI_PerformInteraction); ui_result_code_ = static_cast<hmi_apis::Common_Result::eType>( @@ -236,6 +237,7 @@ void PerformInteractionRequest::on_event(const event_engine::Event& event) { } case hmi_apis::FunctionID::VR_PerformInteraction: { LOG4CXX_DEBUG(logger_, "Received VR_PerformInteraction"); + EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR); vr_response_received_ = true; unsubscribe_from_event(hmi_apis::FunctionID::VR_PerformInteraction); vr_result_code_ = static_cast<hmi_apis::Common_Result::eType>( @@ -502,6 +504,7 @@ void PerformInteractionRequest::SendUIPerformInteractionRequest( (*message_)[strings::msg_params][hmi_request::interaction_layout] .asInt(); } + StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); SendHMIRequest( hmi_apis::FunctionID::UI_PerformInteraction, &msg_params, true); } @@ -594,6 +597,7 @@ void PerformInteractionRequest::SendVRPerformInteractionRequest( msg_params[strings::timeout] = default_timeout_; } msg_params[strings::app_id] = app->app_id(); + StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR); SendHMIRequest( hmi_apis::FunctionID::VR_PerformInteraction, &msg_params, true); } diff --git a/src/components/application_manager/src/commands/mobile/read_did_request.cc b/src/components/application_manager/src/commands/mobile/read_did_request.cc index 0bf747bde3..c51f545e7e 100644 --- a/src/components/application_manager/src/commands/mobile/read_did_request.cc +++ b/src/components/application_manager/src/commands/mobile/read_did_request.cc @@ -87,6 +87,7 @@ void ReadDIDRequest::Run() { (*message_)[strings::msg_params][strings::ecu_name]; msg_params[strings::did_location] = (*message_)[strings::msg_params][strings::did_location]; + StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo); SendHMIRequest(hmi_apis::FunctionID::VehicleInfo_ReadDID, &msg_params, true); } @@ -97,6 +98,7 @@ void ReadDIDRequest::on_event(const event_engine::Event& event) { switch (event.id()) { case hmi_apis::FunctionID::VehicleInfo_ReadDID: { + EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo); hmi_apis::Common_Result::eType result_code = static_cast<hmi_apis::Common_Result::eType>( message[strings::params][hmi_response::code].asInt()); diff --git a/src/components/application_manager/src/commands/mobile/reset_global_properties_request.cc b/src/components/application_manager/src/commands/mobile/reset_global_properties_request.cc index 713d50e190..4f61584be4 100644 --- a/src/components/application_manager/src/commands/mobile/reset_global_properties_request.cc +++ b/src/components/application_manager/src/commands/mobile/reset_global_properties_request.cc @@ -46,10 +46,6 @@ namespace commands { ResetGlobalPropertiesRequest::ResetGlobalPropertiesRequest( const MessageSharedPtr& message, ApplicationManager& application_manager) : CommandRequestImpl(message, application_manager) - , is_ui_send_(false) - , is_tts_send_(false) - , is_ui_received_(false) - , is_tts_received_(false) , ui_result_(hmi_apis::Common_Result::INVALID_ENUM) , tts_result_(hmi_apis::Common_Result::INVALID_ENUM) {} @@ -111,11 +107,11 @@ void ResetGlobalPropertiesRequest::Run() { if (vr_help_title_items || menu_name || menu_icon || is_key_board_properties) { - is_ui_send_ = true; + StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); } if (timeout_prompt || helpt_promt) { - is_tts_send_ = true; + StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS); } app->set_reset_global_properties_active(true); @@ -245,7 +241,7 @@ void ResetGlobalPropertiesRequest::on_event(const event_engine::Event& event) { switch (event.id()) { case hmi_apis::FunctionID::UI_SetGlobalProperties: { LOG4CXX_INFO(logger_, "Received UI_SetGlobalProperties event"); - is_ui_received_ = true; + EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); ui_result_ = static_cast<hmi_apis::Common_Result::eType>( message[strings::params][hmi_response::code].asInt()); GetInfo(message, ui_response_info_); @@ -253,7 +249,7 @@ void ResetGlobalPropertiesRequest::on_event(const event_engine::Event& event) { } case hmi_apis::FunctionID::TTS_SetGlobalProperties: { LOG4CXX_INFO(logger_, "Received TTS_SetGlobalProperties event"); - is_tts_received_ = true; + EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS); tts_result_ = static_cast<hmi_apis::Common_Result::eType>( message[strings::params][hmi_response::code].asInt()); GetInfo(message, tts_response_info_); @@ -321,7 +317,8 @@ bool ResetGlobalPropertiesRequest::PrepareResponseParameters( } bool ResetGlobalPropertiesRequest::IsPendingResponseExist() { - return is_ui_send_ != is_ui_received_ || is_tts_send_ != is_tts_received_; + return IsInterfaceAwaited(HmiInterfaces::HMI_INTERFACE_TTS) || + IsInterfaceAwaited(HmiInterfaces::HMI_INTERFACE_UI); } } // namespace commands diff --git a/src/components/application_manager/src/commands/mobile/scrollable_message_request.cc b/src/components/application_manager/src/commands/mobile/scrollable_message_request.cc index 0c770953fe..b0b2d5f464 100644 --- a/src/components/application_manager/src/commands/mobile/scrollable_message_request.cc +++ b/src/components/application_manager/src/commands/mobile/scrollable_message_request.cc @@ -109,7 +109,7 @@ void ScrollableMessageRequest::Run() { MessageHelper::SubscribeApplicationToSoftButton( (*message_)[strings::msg_params], app, function_id()); } - + StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); SendHMIRequest(hmi_apis::FunctionID::UI_ScrollableMessage, &msg_params, true); } @@ -126,6 +126,7 @@ void ScrollableMessageRequest::on_event(const event_engine::Event& event) { } case hmi_apis::FunctionID::UI_ScrollableMessage: { LOG4CXX_INFO(logger_, "Received UI_ScrollableMessage event"); + EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); hmi_apis::Common_Result::eType result_code = static_cast<hmi_apis::Common_Result::eType>( diff --git a/src/components/application_manager/src/commands/mobile/send_location_request.cc b/src/components/application_manager/src/commands/mobile/send_location_request.cc index 9ec4ca3fcc..54664a8771 100644 --- a/src/components/application_manager/src/commands/mobile/send_location_request.cc +++ b/src/components/application_manager/src/commands/mobile/send_location_request.cc @@ -125,6 +125,7 @@ void SendLocationRequest::Run() { SmartObject request_msg_params = SmartObject(smart_objects::SmartType_Map); request_msg_params = msg_params; request_msg_params[strings::app_id] = app->hmi_app_id(); + StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation); SendHMIRequest( hmi_apis::FunctionID::Navigation_SendLocation, &request_msg_params, true); } @@ -135,6 +136,7 @@ void SendLocationRequest::on_event(const event_engine::Event& event) { const smart_objects::SmartObject& message = event.smart_object(); if (hmi_apis::FunctionID::Navigation_SendLocation == event.id()) { LOG4CXX_INFO(logger_, "Received Navigation_SendLocation event"); + EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation); const Common_Result::eType result_code = static_cast<Common_Result::eType>( message[strings::params][hmi_response::code].asInt()); std::string response_info; diff --git a/src/components/application_manager/src/commands/mobile/set_app_icon_request.cc b/src/components/application_manager/src/commands/mobile/set_app_icon_request.cc index 5afddfb4d0..ee544e956a 100644 --- a/src/components/application_manager/src/commands/mobile/set_app_icon_request.cc +++ b/src/components/application_manager/src/commands/mobile/set_app_icon_request.cc @@ -114,7 +114,7 @@ void SetAppIconRequest::Run() { // for further use in on_event function (*message_)[strings::msg_params][strings::sync_file_name] = msg_params[strings::sync_file_name]; - + StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); SendHMIRequest(hmi_apis::FunctionID::UI_SetAppIcon, &msg_params, true); } @@ -242,6 +242,7 @@ void SetAppIconRequest::on_event(const event_engine::Event& event) { switch (event.id()) { case hmi_apis::FunctionID::UI_SetAppIcon: { + EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); hmi_apis::Common_Result::eType result_code = static_cast<hmi_apis::Common_Result::eType>( message[strings::params][hmi_response::code].asInt()); diff --git a/src/components/application_manager/src/commands/mobile/set_display_layout_request.cc b/src/components/application_manager/src/commands/mobile/set_display_layout_request.cc index 984690384a..38b62ce731 100644 --- a/src/components/application_manager/src/commands/mobile/set_display_layout_request.cc +++ b/src/components/application_manager/src/commands/mobile/set_display_layout_request.cc @@ -58,6 +58,7 @@ void SetDisplayLayoutRequest::Run() { } (*message_)[strings::msg_params][strings::app_id] = app->app_id(); + StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); SendHMIRequest(hmi_apis::FunctionID::UI_SetDisplayLayout, &((*message_)[strings::msg_params]), true); @@ -70,6 +71,7 @@ void SetDisplayLayoutRequest::on_event(const event_engine::Event& event) { switch (event.id()) { case hmi_apis::FunctionID::UI_SetDisplayLayout: { LOG4CXX_INFO(logger_, "Received UI_SetDisplayLayout event"); + EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); hmi_apis::Common_Result::eType result_code = static_cast<hmi_apis::Common_Result::eType>( message[strings::params][hmi_response::code].asInt()); diff --git a/src/components/application_manager/src/commands/mobile/set_global_properties_request.cc b/src/components/application_manager/src/commands/mobile/set_global_properties_request.cc index 096c4ed783..d1cb0486ba 100644 --- a/src/components/application_manager/src/commands/mobile/set_global_properties_request.cc +++ b/src/components/application_manager/src/commands/mobile/set_global_properties_request.cc @@ -229,6 +229,7 @@ void SetGlobalPropertiesRequest::on_event(const event_engine::Event& event) { switch (event.id()) { case hmi_apis::FunctionID::UI_SetGlobalProperties: { LOG4CXX_INFO(logger_, "Received UI_SetGlobalProperties event"); + EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); is_ui_received_ = true; ui_result_ = static_cast<hmi_apis::Common_Result::eType>( message[strings::params][hmi_response::code].asInt()); @@ -237,6 +238,7 @@ void SetGlobalPropertiesRequest::on_event(const event_engine::Event& event) { } case hmi_apis::FunctionID::TTS_SetGlobalProperties: { LOG4CXX_INFO(logger_, "Received TTS_SetGlobalProperties event"); + EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS); is_tts_received_ = true; tts_result_ = static_cast<hmi_apis::Common_Result::eType>( message[strings::params][hmi_response::code].asInt()); @@ -397,6 +399,7 @@ void SetGlobalPropertiesRequest::SendTTSRequest( const smart_objects::SmartObject& params, bool use_events) { LOG4CXX_AUTO_TRACE(logger_); is_tts_send_ = true; + StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS); SendHMIRequest( hmi_apis::FunctionID::TTS_SetGlobalProperties, ¶ms, use_events); } @@ -405,6 +408,7 @@ void SetGlobalPropertiesRequest::SendUIRequest( const smart_objects::SmartObject& params, bool use_events) { LOG4CXX_AUTO_TRACE(logger_); is_ui_send_ = true; + StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); SendHMIRequest( hmi_apis::FunctionID::UI_SetGlobalProperties, ¶ms, use_events); } diff --git a/src/components/application_manager/src/commands/mobile/set_icon_request.cc b/src/components/application_manager/src/commands/mobile/set_icon_request.cc index 85f34aead9..037de54456 100644 --- a/src/components/application_manager/src/commands/mobile/set_icon_request.cc +++ b/src/components/application_manager/src/commands/mobile/set_icon_request.cc @@ -95,7 +95,7 @@ void SetIconRequest::Run() { // for further use in on_event function (*message_)[strings::msg_params][strings::sync_file_name] = msg_params[strings::sync_file_name]; - + StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); SendHMIRequest(hmi_apis::FunctionID::UI_SetAppIcon, &msg_params, true); } @@ -105,6 +105,7 @@ void SetIconRequest::on_event(const event_engine::Event& event) { switch (event.id()) { case hmi_apis::FunctionID::UI_SetAppIcon: { + EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); mobile_apis::Result::eType result_code = static_cast<mobile_apis::Result::eType>( message[strings::params][hmi_response::code].asInt()); diff --git a/src/components/application_manager/src/commands/mobile/set_media_clock_timer_request.cc b/src/components/application_manager/src/commands/mobile/set_media_clock_timer_request.cc index 1e0a00318d..54727abe01 100644 --- a/src/components/application_manager/src/commands/mobile/set_media_clock_timer_request.cc +++ b/src/components/application_manager/src/commands/mobile/set_media_clock_timer_request.cc @@ -71,6 +71,7 @@ void SetMediaClockRequest::Run() { // copy entirely msg msg_params = (*message_)[strings::msg_params]; msg_params[strings::app_id] = app->app_id(); + StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); SendHMIRequest( hmi_apis::FunctionID::UI_SetMediaClockTimer, &msg_params, true); @@ -85,6 +86,7 @@ void SetMediaClockRequest::on_event(const event_engine::Event& event) { switch (event.id()) { case hmi_apis::FunctionID::UI_SetMediaClockTimer: { + EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); hmi_apis::Common_Result::eType result_code = static_cast<hmi_apis::Common_Result::eType>( message[strings::params][hmi_response::code].asInt()); diff --git a/src/components/application_manager/src/commands/mobile/show_constant_tbt_request.cc b/src/components/application_manager/src/commands/mobile/show_constant_tbt_request.cc index b1cc40009d..42bfea4864 100644 --- a/src/components/application_manager/src/commands/mobile/show_constant_tbt_request.cc +++ b/src/components/application_manager/src/commands/mobile/show_constant_tbt_request.cc @@ -172,6 +172,7 @@ void ShowConstantTBTRequest::Run() { } app->set_tbt_show_command(msg_params); + StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation); SendHMIRequest( hmi_apis::FunctionID::Navigation_ShowConstantTBT, &msg_params, true); } @@ -184,6 +185,7 @@ void ShowConstantTBTRequest::on_event(const event_engine::Event& event) { switch (event.id()) { case hmi_apis::FunctionID::Navigation_ShowConstantTBT: { LOG4CXX_INFO(logger_, "Received Navigation_ShowConstantTBT event"); + EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation); const Common_Result::eType result_code = static_cast<Common_Result::eType>( message[strings::params][hmi_response::code].asInt()); diff --git a/src/components/application_manager/src/commands/mobile/show_request.cc b/src/components/application_manager/src/commands/mobile/show_request.cc index 5b8e98d7ea..ad598efc1d 100644 --- a/src/components/application_manager/src/commands/mobile/show_request.cc +++ b/src/components/application_manager/src/commands/mobile/show_request.cc @@ -263,6 +263,7 @@ void ShowRequest::Run() { (*message_)[strings::msg_params][strings::custom_presets]; } + StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); SendHMIRequest(hmi_apis::FunctionID::UI_Show, &msg_params, true); MessageSharedPtr persistentData = new smart_objects::SmartObject(msg_params); @@ -278,6 +279,7 @@ void ShowRequest::on_event(const event_engine::Event& event) { switch (event.id()) { case hmi_apis::FunctionID::UI_Show: { LOG4CXX_DEBUG(logger_, "Received UI_Show event."); + EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); std::string response_info; hmi_apis::Common_Result::eType result_code = static_cast<hmi_apis::Common_Result::eType>( diff --git a/src/components/application_manager/src/commands/mobile/slider_request.cc b/src/components/application_manager/src/commands/mobile/slider_request.cc index 054d0ec16d..f98869b08f 100644 --- a/src/components/application_manager/src/commands/mobile/slider_request.cc +++ b/src/components/application_manager/src/commands/mobile/slider_request.cc @@ -107,6 +107,7 @@ void SliderRequest::Run() { msg_params[strings::timeout] = default_timeout_; } + StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); SendHMIRequest(hmi_apis::FunctionID::UI_Slider, &msg_params, true); } @@ -132,7 +133,7 @@ void SliderRequest::on_event(const event_engine::Event& event) { } LOG4CXX_DEBUG(logger_, "Received UI_Slider event"); - + EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); const Common_Result::eType response_code = static_cast<Common_Result::eType>( message[strings::params][hmi_response::code].asInt()); diff --git a/src/components/application_manager/src/commands/mobile/speak_request.cc b/src/components/application_manager/src/commands/mobile/speak_request.cc index 6cbb762102..1954cde181 100644 --- a/src/components/application_manager/src/commands/mobile/speak_request.cc +++ b/src/components/application_manager/src/commands/mobile/speak_request.cc @@ -72,6 +72,7 @@ void SpeakRequest::Run() { (*message_)[strings::msg_params][strings::app_id] = app->app_id(); (*message_)[strings::msg_params][hmi_request::speak_type] = hmi_apis::Common_MethodName::SPEAK; + StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS); SendHMIRequest(hmi_apis::FunctionID::TTS_Speak, &message_->getElement(strings::msg_params), true); @@ -82,7 +83,7 @@ void SpeakRequest::on_event(const event_engine::Event& event) { switch (event.id()) { case hmi_apis::FunctionID::TTS_Speak: { LOG4CXX_INFO(logger_, "Received TTS_Speak event"); - + EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS); ProcessTTSSpeakResponse(event.smart_object()); break; } diff --git a/src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_request.cc b/src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_request.cc index 28651cded4..f4b7e7c8aa 100644 --- a/src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_request.cc +++ b/src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_request.cc @@ -149,6 +149,7 @@ void SubscribeVehicleDataRequest::Run() { ++it) SendHMIRequest(it->func_id, &msg_params, true); #else + StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo); SendHMIRequest(hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData, &msg_params, true); @@ -165,7 +166,7 @@ void SubscribeVehicleDataRequest::on_event(const event_engine::Event& event) { LOG4CXX_ERROR(logger_, "Received unknown event."); return; } - + EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo); ApplicationSharedPtr app = application_manager_.application(CommandRequestImpl::connection_key()); diff --git a/src/components/application_manager/src/commands/mobile/subscribe_way_points_request.cc b/src/components/application_manager/src/commands/mobile/subscribe_way_points_request.cc index 0e0d760228..965741edf7 100644 --- a/src/components/application_manager/src/commands/mobile/subscribe_way_points_request.cc +++ b/src/components/application_manager/src/commands/mobile/subscribe_way_points_request.cc @@ -36,6 +36,7 @@ void SubscribeWayPointsRequest::Run() { return; } + StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation); SendHMIRequest( hmi_apis::FunctionID::Navigation_SubscribeWayPoints, NULL, true); } @@ -47,6 +48,7 @@ void SubscribeWayPointsRequest::on_event(const event_engine::Event& event) { switch (event.id()) { case hmi_apis::FunctionID::Navigation_SubscribeWayPoints: { LOG4CXX_INFO(logger_, "Received Navigation_SubscribeWayPoints event"); + EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation); const hmi_apis::Common_Result::eType result_code = static_cast<hmi_apis::Common_Result::eType>( message[strings::params][hmi_response::code].asInt()); diff --git a/src/components/application_manager/src/commands/mobile/system_request.cc b/src/components/application_manager/src/commands/mobile/system_request.cc index f3fcf85b65..fe38b93732 100644 --- a/src/components/application_manager/src/commands/mobile/system_request.cc +++ b/src/components/application_manager/src/commands/mobile/system_request.cc @@ -587,6 +587,7 @@ void SystemRequest::Run() { msg_params[strings::request_type] = (*message_)[strings::msg_params][strings::request_type]; + StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_BasicCommunication); SendHMIRequest(hmi_apis::FunctionID::BasicCommunication_SystemRequest, &msg_params, true); @@ -600,6 +601,7 @@ void SystemRequest::on_event(const event_engine::Event& event) { switch (event.id()) { case hmi_apis::FunctionID::BasicCommunication_SystemRequest: { + EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_BasicCommunication); mobile_apis::Result::eType result_code = GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>( message[strings::params][hmi_response::code].asUInt())); diff --git a/src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_request.cc b/src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_request.cc index fa3a9ad400..037c3fa4a4 100644 --- a/src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_request.cc +++ b/src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_request.cc @@ -234,6 +234,7 @@ void UnsubscribeVehicleDataRequest::Run() { ++it) SendHMIRequest(it->func_id, &msg_params, true); #else + StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo); SendHMIRequest(hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData, &msg_params, true); @@ -250,6 +251,7 @@ void UnsubscribeVehicleDataRequest::on_event(const event_engine::Event& event) { LOG4CXX_ERROR(logger_, "Received unknown event."); return; } + EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo); #ifdef HMI_DBUS_API for (HmiRequests::iterator it = hmi_requests_.begin(); diff --git a/src/components/application_manager/src/commands/mobile/unsubscribe_way_points_request.cc b/src/components/application_manager/src/commands/mobile/unsubscribe_way_points_request.cc index 953bbc7a12..88ed396250 100644 --- a/src/components/application_manager/src/commands/mobile/unsubscribe_way_points_request.cc +++ b/src/components/application_manager/src/commands/mobile/unsubscribe_way_points_request.cc @@ -30,6 +30,7 @@ void UnSubscribeWayPointsRequest::Run() { return; } + StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation); SendHMIRequest( hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints, NULL, true); } @@ -41,6 +42,7 @@ void UnSubscribeWayPointsRequest::on_event(const event_engine::Event& event) { switch (event.id()) { case hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints: { LOG4CXX_INFO(logger_, "Received Navigation_UnSubscribeWayPoints event"); + EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation); const hmi_apis::Common_Result::eType result_code = static_cast<hmi_apis::Common_Result::eType>( message[strings::params][hmi_response::code].asInt()); diff --git a/src/components/application_manager/src/commands/mobile/update_turn_list_request.cc b/src/components/application_manager/src/commands/mobile/update_turn_list_request.cc index becab175e9..44fe9d0d07 100644 --- a/src/components/application_manager/src/commands/mobile/update_turn_list_request.cc +++ b/src/components/application_manager/src/commands/mobile/update_turn_list_request.cc @@ -138,6 +138,7 @@ void UpdateTurnListRequest::Run() { if ((*message_)[strings::msg_params].keyExists(strings::turn_list) || (*message_)[strings::msg_params].keyExists(strings::soft_buttons)) { + StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation); SendHMIRequest( hmi_apis::FunctionID::Navigation_UpdateTurnList, &msg_params, true); } else { @@ -154,7 +155,7 @@ void UpdateTurnListRequest::on_event(const event_engine::Event& event) { switch (event.id()) { case hmi_apis::FunctionID::Navigation_UpdateTurnList: { LOG4CXX_INFO(logger_, "Received Navigation_UpdateTurnList event"); - + EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation); const hmi_apis::Common_Result::eType result_code = static_cast<hmi_apis::Common_Result::eType>( message[strings::params][hmi_response::code].asInt()); |