diff options
-rw-r--r-- | src/components/application_manager/include/application_manager/commands/mobile/show_request.h | 3 | ||||
-rw-r--r-- | src/components/application_manager/src/commands/mobile/show_request.cc | 22 |
2 files changed, 21 insertions, 4 deletions
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/show_request.h b/src/components/application_manager/include/application_manager/commands/mobile/show_request.h index 7e07be1c9a..a10997bacd 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/show_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/show_request.h @@ -86,6 +86,9 @@ class ShowRequest : public CommandRequestImpl { int32_t field_index, smart_objects::SmartObject& msg_params); + mobile_apis::Result::eType core_result_code_; + std::string core_response_info_; + DISALLOW_COPY_AND_ASSIGN(ShowRequest); }; 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 8f51afa9b6..00cdc2a603 100644 --- a/src/components/application_manager/src/commands/mobile/show_request.cc +++ b/src/components/application_manager/src/commands/mobile/show_request.cc @@ -45,7 +45,8 @@ namespace commands { ShowRequest::ShowRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandRequestImpl(message, application_manager) {} + : CommandRequestImpl(message, application_manager) + , core_result_code_(mobile_apis::Result::INVALID_ENUM) {} ShowRequest::~ShowRequest() {} @@ -69,8 +70,14 @@ void ShowRequest::HandleMetadata(const char* field_id, } } else { LOG4CXX_INFO(logger_, - "metadata tag provided with no item for " << field_id - << ", ignoring"); + "metadata tag provided with no item for " + << field_id << ", ignoring with warning"); + // tag provided with no item, ignore with warning + if (mobile_apis::Result::INVALID_ENUM == core_result_code_) { + core_result_code_ = mobile_apis::Result::IGNORED; + core_response_info_ = + "Metadata tag was provided for a field with no data."; + } } } else { LOG4CXX_INFO(logger_, @@ -284,8 +291,15 @@ void ShowRequest::on_event(const event_engine::Event& event) { response_info = message[strings::params][hmi_response::message].asString(); } + mobile_apis::Result::eType converted_result_code = + MessageHelper::HMIToMobileResult(result_code); + if (mobile_apis::Result::SUCCESS == converted_result_code && + mobile_apis::Result::INVALID_ENUM != core_result_code_) { + converted_result_code = core_result_code_; + response_info = core_response_info_; + } SendResponse(result, - MessageHelper::HMIToMobileResult(result_code), + converted_result_code, response_info.empty() ? NULL : response_info.c_str(), &(message[strings::msg_params])); break; |