diff options
author | Shobhit Adlakha <adlakhashobhit@gmail.com> | 2019-09-23 12:20:55 -0400 |
---|---|---|
committer | Shobhit Adlakha <adlakhashobhit@gmail.com> | 2019-09-23 12:20:55 -0400 |
commit | 85811680b5ddb42f76c466309a3dea912ddb654c (patch) | |
tree | 867b2cbe0a8200f6b1c610d182c30adce1da0d6a | |
parent | 4a1a53f39a931063e36ed0b1538868f02647f327 (diff) | |
download | sdl_core-fix/givdc_user_location_check.tar.gz |
Check result code for hmi response before checking allowed paramfix/givdc_user_location_check
-rw-r--r-- | src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_consent_request.cc | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_consent_request.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_consent_request.cc index 5adc1c399b..2f7363b2ee 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_consent_request.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_consent_request.cc @@ -140,6 +140,24 @@ void GetInteriorVehicleDataConsentRequest::on_event( auto temp_response = event.smart_object(); + auto result_code = + GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>( + temp_response[app_mngr::strings::params][app_mngr::hmi_response::code] + .asUInt())); + + const bool success_result = + helpers::Compare<mobile_apis::Result::eType, helpers::EQ, helpers::ONE>( + result_code, + mobile_apis::Result::SUCCESS, + mobile_apis::Result::WARNINGS); + + if (!success_result) { + std::string info; + GetInfo(temp_response, info); + SendResponse(false, result_code, info.c_str(), nullptr); + return; + } + if (!temp_response[app_mngr::strings::msg_params].keyExists( message_params::kAllowed) || temp_response[app_mngr::strings::msg_params][message_params::kAllowed] @@ -203,19 +221,8 @@ void GetInteriorVehicleDataConsentRequest::on_event( return; } - auto result_code = - GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>( - hmi_response[app_mngr::strings::params][app_mngr::hmi_response::code] - .asUInt())); - - const bool success_result = - helpers::Compare<mobile_apis::Result::eType, helpers::EQ, helpers::ONE>( - result_code, - mobile_apis::Result::SUCCESS, - mobile_apis::Result::WARNINGS); - - smart_objects::SmartObject response_params; - response_params = hmi_response[app_mngr::strings::msg_params]; + smart_objects::SmartObject response_params = + hmi_response[app_mngr::strings::msg_params]; std::string info; GetInfo(hmi_response, info); SendResponse(success_result, |