diff options
author | SKobziev <skobziev@luxoft.com> | 2018-09-11 09:58:49 +0300 |
---|---|---|
committer | SKobziev <skobziev@luxoft.com> | 2018-11-28 15:17:45 +0200 |
commit | 6680afad59662768d86b5cf651d60e710f8e854d (patch) | |
tree | e4d1d1c9cb74bdcf0c914c9edd35e55deac2c6bc | |
parent | 922fd38b6fd9399bb9467d7f5b17dcd03f832afc (diff) | |
download | sdl_core-fix/SDL_behavior_in_case_HMI_responds_with_WARNINGS_to_at_least_one_VR_DeleteCommands_AND_app_sends_PerfromInteraction_related_to_this_ChoiceSet.tar.gz |
Change perform Interaction send INVALID _ID instead REJECTEDfix/SDL_behavior_in_case_HMI_responds_with_WARNINGS_to_at_least_one_VR_DeleteCommands_AND_app_sends_PerfromInteraction_related_to_this_ChoiceSet
In case of processing DeleteInteractionChoiceSet HMI Perform Interaction send INVALID _ID instead REJECTED.
This commit corrected this behavior in PerformInteractionRequest::CheckChoiceIDFromRequest.
2 files changed, 14 insertions, 13 deletions
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_interaction_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_interaction_request.h index 2d4cbc9afc..c9450a20da 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_interaction_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_interaction_request.h @@ -203,11 +203,10 @@ class PerformInteractionRequest * @param choice_set_id_list_length contains amount * of choice set ids. * @param choice_set_id_list array of choice set ids - * @return If request contains several choice sets with - * same choice id returns false, otherwise returns - * true. + * @return the result of checking for a match of + * choice ID in choice sets */ - bool CheckChoiceIDFromRequest( + const mobile_apis::Result::eType CheckChoiceIDFromRequest( app_mngr::ApplicationSharedPtr app, const size_t choice_set_id_list_length, const smart_objects::SmartObject& choice_set_id_list) const; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc index 42489fd8bd..c17082b7fe 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc @@ -153,14 +153,15 @@ void PerformInteractionRequest::Run() { } } - if (!CheckChoiceIDFromRequest( - app, - choice_set_id_list_length, - msg_params[strings::interaction_choice_set_id_list])) { + const auto result = CheckChoiceIDFromRequest( + app, + choice_set_id_list_length, + msg_params[strings::interaction_choice_set_id_list]); + if (mobile_apis::Result::SUCCESS != result) { LOG4CXX_ERROR(logger_, "PerformInteraction has choice sets with " "duplicated IDs or application does not have choice sets"); - SendResponse(false, mobile_apis::Result::INVALID_ID); + SendResponse(false, result); return; } @@ -996,7 +997,8 @@ bool PerformInteractionRequest::CheckChoiceSetListVRCommands( return true; } -bool PerformInteractionRequest::CheckChoiceIDFromRequest( +const mobile_apis::Result::eType +PerformInteractionRequest::CheckChoiceIDFromRequest( ApplicationSharedPtr app, const size_t choice_set_id_list_length, const smart_objects::SmartObject& choice_set_id_list) const { @@ -1013,7 +1015,7 @@ bool PerformInteractionRequest::CheckChoiceIDFromRequest( LOG4CXX_ERROR( logger_, "Couldn't find choiceset_id = " << choice_set_id_list[i].asInt()); - return false; + return mobile_apis::Result::REJECTED; } choice_list_length = (*choice_set)[strings::choice_set].length(); @@ -1027,11 +1029,11 @@ bool PerformInteractionRequest::CheckChoiceIDFromRequest( "choice with ID " << choices_list[k][strings::choice_id].asInt() << " already exists"); - return false; + return mobile_apis::Result::INVALID_ID; } } } - return true; + return mobile_apis::Result::SUCCESS; } const bool PerformInteractionRequest::HasHMIResponsesToWait() const { |