diff options
Diffstat (limited to 'src/components/application_manager/src/commands/mobile/set_global_properties_request.cc')
-rw-r--r-- | src/components/application_manager/src/commands/mobile/set_global_properties_request.cc | 41 |
1 files changed, 25 insertions, 16 deletions
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..75d08f9f26 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 @@ -152,6 +152,9 @@ void SetGlobalPropertiesRequest::Run() { params[strings::app_id] = app->app_id(); SendUIRequest(params, true); + + auto& help_prompt_manager = app->help_prompt_manager(); + help_prompt_manager.OnSetGlobalPropertiesReceived(params, false); } else { LOG4CXX_DEBUG(logger_, "VRHelp params does not present"); DCHECK_OR_RETURN_VOID(!is_vr_help_title_present && !is_vr_help_present); @@ -159,15 +162,6 @@ void SetGlobalPropertiesRequest::Run() { smart_objects::SmartObject params = smart_objects::SmartObject(smart_objects::SmartType_Map); - if (ValidateVRHelpTitle(app->vr_help_title())) { - LOG4CXX_DEBUG(logger_, "App already contains VRHelp data"); - } else { - if (!PrepareUIRequestDefaultVRHelpData(app, params)) { - LOG4CXX_ERROR(logger_, "default VRHElp data could not be generated"); - SendResponse(false, mobile_apis::Result::INVALID_DATA); - return; - } - } PrepareUIRequestMenuAndKeyboardData(app, msg_params, params); // Preparing data @@ -197,6 +191,9 @@ void SetGlobalPropertiesRequest::Run() { params[strings::app_id] = app->app_id(); SendTTSRequest(params, true); + + auto& help_prompt_manager = app->help_prompt_manager(); + help_prompt_manager.OnSetGlobalPropertiesReceived(params, false); } } @@ -226,21 +223,34 @@ void SetGlobalPropertiesRequest::on_event(const event_engine::Event& event) { using namespace helpers; const smart_objects::SmartObject& message = event.smart_object(); + ApplicationSharedPtr application = + application_manager_.application(connection_key()); + 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()); GetInfo(message, ui_response_info_); + if (application.valid()) { + auto& help_prompt_manager = application->help_prompt_manager(); + help_prompt_manager.OnSetGlobalPropertiesReceived(message, true); + } break; } 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()); GetInfo(message, tts_response_info_); + if (application.valid()) { + auto& help_prompt_manager = application->help_prompt_manager(); + help_prompt_manager.OnSetGlobalPropertiesReceived(message, true); + } break; } default: { @@ -257,10 +267,6 @@ void SetGlobalPropertiesRequest::on_event(const event_engine::Event& event) { std::string response_info; const bool result = PrepareResponseParameters(result_code, response_info); - // TODO{ALeshin} APPLINK-15858. connection_key removed during SendResponse - ApplicationSharedPtr application = - application_manager_.application(connection_key()); - SendResponse(result, result_code, response_info.empty() ? NULL : response_info.c_str(), @@ -277,10 +283,11 @@ bool SetGlobalPropertiesRequest::PrepareResponseParameters( LOG4CXX_AUTO_TRACE(logger_); using namespace helpers; - ResponseInfo ui_properties_info(ui_result_, HmiInterfaces::HMI_INTERFACE_UI); + ResponseInfo ui_properties_info( + ui_result_, HmiInterfaces::HMI_INTERFACE_UI, application_manager_); - ResponseInfo tts_properties_info(tts_result_, - HmiInterfaces::HMI_INTERFACE_TTS); + ResponseInfo tts_properties_info( + tts_result_, HmiInterfaces::HMI_INTERFACE_TTS, application_manager_); const bool result = PrepareResultForMobileResponse(ui_properties_info, tts_properties_info); if (result && @@ -397,6 +404,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 +413,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); } |