diff options
Diffstat (limited to 'src/components/application_manager/src/commands/mobile/show_constant_tbt_request.cc')
-rw-r--r-- | src/components/application_manager/src/commands/mobile/show_constant_tbt_request.cc | 29 |
1 files changed, 10 insertions, 19 deletions
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 2d79e13582..b1cc40009d 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 @@ -178,31 +178,22 @@ void ShowConstantTBTRequest::Run() { void ShowConstantTBTRequest::on_event(const event_engine::Event& event) { LOG4CXX_AUTO_TRACE(logger_); + using namespace hmi_apis; const smart_objects::SmartObject& message = event.smart_object(); switch (event.id()) { case hmi_apis::FunctionID::Navigation_ShowConstantTBT: { LOG4CXX_INFO(logger_, "Received Navigation_ShowConstantTBT event"); - std::string return_info; - - mobile_apis::Result::eType result_code = - GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>( - message[strings::params][hmi_response::code].asInt())); - HMICapabilities& hmi_capabilities = - application_manager_.hmi_capabilities(); - bool result = false; - if (mobile_apis::Result::SUCCESS == result_code) { - result = true; - return_info = - message[strings::msg_params][hmi_response::message].asString(); - } else if ((mobile_apis::Result::UNSUPPORTED_RESOURCE == result_code) && - hmi_capabilities.is_ui_cooperating()) { - result = true; - } - + const Common_Result::eType result_code = + static_cast<Common_Result::eType>( + message[strings::params][hmi_response::code].asInt()); + std::string response_info; + GetInfo(message, response_info); + const bool result = PrepareResultForMobileResponse( + result_code, HmiInterfaces::HMI_INTERFACE_Navigation); SendResponse(result, - result_code, - return_info.empty() ? 0 : return_info.c_str(), + MessageHelper::HMIToMobileResult(result_code), + response_info.empty() ? NULL : response_info.c_str(), &(message[strings::msg_params])); break; } |