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 f585410e97c..5a6bf721450 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 @@ -233,8 +233,8 @@ class CommandRequestImpl : public CommandImpl, * @return true if result code complies successful result code * otherwise returns false */ - bool PrepareResultForMobileResponse(ResponseInfo& out_first, - ResponseInfo& out_second) const; + virtual bool PrepareResultForMobileResponse(ResponseInfo& out_first, + ResponseInfo& out_second) const; /** * @brief If message from HMI contains returns this info @@ -256,7 +256,7 @@ class CommandRequestImpl : public CommandImpl, * interface that returns response. * @return resulting code for sending to mobile application. */ - mobile_apis::Result::eType PrepareResultCodeForResponse( + virtual mobile_apis::Result::eType PrepareResultCodeForResponse( const ResponseInfo& first, const ResponseInfo& second); protected: diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_request.h b/src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_request.h index 0300245af84..719aed86e2c 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_request.h @@ -133,6 +133,29 @@ class SetGlobalPropertiesRequest : public CommandRequestImpl { */ bool PrepareResponseParameters(mobile_apis::Result::eType& result_code, std::string& info); + /** + * @brief Checks result code from HMI for splitted RPC + * and returns parameter for sending to mobile app. + * @param ui_info contains result_code from HMI response and + * interface that returns ui response + * @param tts_info contains result_code from HMI response and + * interface that returns tts response + * @return true if result code complies successful result code + * otherwise returns false + */ + bool PrepareResultForMobileResponse(ResponseInfo& ui_info, + ResponseInfo& tts_info) const FINAL; + + /** + * @brief Prepare result code for sending to mobile application + * @param ui_info contains result_code from HMI response and + * interface that returns ui response + * @param tts_info contains result_code from HMI response and + * interface that returns tts response. + * @return resulting code for sending to mobile application. + */ + mobile_apis::Result::eType PrepareResultCodeForResponse( + const ResponseInfo& ui_info, const ResponseInfo& tts_info) FINAL; bool is_ui_send_; bool is_tts_send_; 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 fcfea5e7446..8a7f0690fa3 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 @@ -276,6 +276,30 @@ void SetGlobalPropertiesRequest::on_event(const event_engine::Event& event) { } } +bool SetGlobalPropertiesRequest::PrepareResultForMobileResponse( + ResponseInfo& ui_info, ResponseInfo& tts_info) const { + const bool result = + CommandRequestImpl::PrepareResultForMobileResponse(ui_info, tts_info); + if (ui_info.is_ok && tts_info.is_unsupported_resource) { + return true; + } + return result; +} + +mobile_apis::Result::eType +SetGlobalPropertiesRequest::PrepareResultCodeForResponse( + const ResponseInfo& ui_info, const ResponseInfo& tts_info) { + if (ui_info.is_ok && tts_info.is_unsupported_resource) { + return mobile_apis::Result::WARNINGS; + } + if (HmiInterfaces::STATE_AVAILABLE == tts_info.interface_state && + tts_info.is_unsupported_resource) { + tts_response_info_ = "Unsupported phoneme type sent in a prompt"; + return mobile_apis::Result::WARNINGS; + } + return CommandRequestImpl::PrepareResultCodeForResponse(ui_info, tts_info); +} + bool SetGlobalPropertiesRequest::PrepareResponseParameters( mobile_apis::Result::eType& result_code, std::string& info) { LOG4CXX_AUTO_TRACE(logger_); @@ -287,17 +311,6 @@ bool SetGlobalPropertiesRequest::PrepareResponseParameters( HmiInterfaces::HMI_INTERFACE_TTS); const bool result = PrepareResultForMobileResponse(ui_properties_info, tts_properties_info); - if (result && - (HmiInterfaces::STATE_AVAILABLE == tts_properties_info.interface_state) && - (tts_properties_info.is_unsupported_resource)) { - result_code = mobile_apis::Result::WARNINGS; - tts_response_info_ = "Unsupported phoneme type sent in a prompt"; - info = MergeInfos(tts_properties_info, - tts_response_info_, - ui_properties_info, - ui_response_info_); - return result; - } result_code = PrepareResultCodeForResponse(ui_properties_info, tts_properties_info); info = MergeInfos(tts_properties_info,