diff options
author | Maksym Ked (GitHub) <mked@luxoft.com> | 2018-09-05 17:45:57 +0300 |
---|---|---|
committer | Andriy Byzhynar <abyzhynar@luxoft.com> | 2018-09-17 16:53:28 +0300 |
commit | 0d397fa6dc01a53d56665080308f2f3cf8e7e02b (patch) | |
tree | 8e5743b3b6fd9cda1c8c2a8114db0b0b3c8de0e1 | |
parent | 57ba790b19d6ff211b6eff3f9c714e2686952121 (diff) | |
download | sdl_core-0d397fa6dc01a53d56665080308f2f3cf8e7e02b.tar.gz |
changed IsRequestSuccessful parameter from result code to smart object
2 files changed, 8 insertions, 9 deletions
diff --git a/src/components/application_manager/include/application_manager/resumption/resumption_data_processor.h b/src/components/application_manager/include/application_manager/resumption/resumption_data_processor.h index 918988a47e..6547bf49f3 100644 --- a/src/components/application_manager/include/application_manager/resumption/resumption_data_processor.h +++ b/src/components/application_manager/include/application_manager/resumption/resumption_data_processor.h @@ -281,9 +281,9 @@ class ResumptionDataProcessor : public app_mngr::event_engine::EventObserver { /** * @brief Determines whether request is successful * judging from result code received from HMI - * @param result_code received from HMI + * @param response from HMI with request's result code */ - bool IsRequestSuccessful(const hmi_apis::Common_Result::eType result_code) const; + bool IsRequestSuccessful(const smart_objects::SmartObject& response) const; /** * @brief A map of the IDs and Application Resumption Status for these ID diff --git a/src/components/application_manager/src/resumption/resumption_data_processor.cc b/src/components/application_manager/src/resumption/resumption_data_processor.cc index 1180ee0ad2..aafaf27bf8 100644 --- a/src/components/application_manager/src/resumption/resumption_data_processor.cc +++ b/src/components/application_manager/src/resumption/resumption_data_processor.cc @@ -136,12 +136,7 @@ void ResumptionDataProcessor::on_event(const event_engine::Event& event) { return; } - const hmi_apis::Common_Result::eType result_code = - static_cast<hmi_apis::Common_Result::eType>( - response[strings::params][application_manager::hmi_response::code] - .asInt()); - - if (IsRequestSuccessful(result_code)) { + if (IsRequestSuccessful(response)) { status.successful_requests.push_back(*request_ptr); } else { status.error_requests.push_back(*request_ptr); @@ -656,7 +651,11 @@ void ResumptionDataProcessor::DeletePluginsSubscriptions( } } -bool ResumptionDataProcessor::IsRequestSuccessful(const hmi_apis::Common_Result::eType result_code) const { +bool ResumptionDataProcessor::IsRequestSuccessful(const smart_objects::SmartObject& response) const { + const hmi_apis::Common_Result::eType result_code = + static_cast<hmi_apis::Common_Result::eType>( + response[strings::params][application_manager::hmi_response::code] + .asInt()); return result_code == hmi_apis::Common_Result::SUCCESS || result_code == hmi_apis::Common_Result::WARNINGS; } |