diff options
author | Oleh Herasym (GitHub) <oolleehh@gmail.com> | 2016-10-13 13:48:35 +0300 |
---|---|---|
committer | Anton Hrytsevich (GitHub) <AGritsevich@users.noreply.github.com> | 2016-10-13 13:48:35 +0300 |
commit | 671ff4baacc1f069b12debf54bff2667e7d76dd0 (patch) | |
tree | 9240f63ecfb4d911015b0a8cdd73579fe48a4725 | |
parent | 6d6394c3ebabd21edfa72944bd207cf8dbaa1828 (diff) | |
download | sdl_core-671ff4baacc1f069b12debf54bff2667e7d76dd0.tar.gz |
Fix change registration wrong code (#902)
* Fix change registration wrong code
Related: APPLINK-28910, 28905
-rw-r--r-- | src/components/application_manager/src/commands/mobile/change_registration_request.cc | 15 | ||||
-rw-r--r-- | src/components/application_manager/test/commands/mobile/change_registration_test.cc | 2 |
2 files changed, 5 insertions, 12 deletions
diff --git a/src/components/application_manager/src/commands/mobile/change_registration_request.cc b/src/components/application_manager/src/commands/mobile/change_registration_request.cc index c14fce13ae..f1f3b93e24 100644 --- a/src/components/application_manager/src/commands/mobile/change_registration_request.cc +++ b/src/components/application_manager/src/commands/mobile/change_registration_request.cc @@ -241,15 +241,6 @@ void CheckInfo(std::string& str) { str.clear(); } } - -bool CheckResultCode(const ResponseInfo& first, const ResponseInfo& second) { - if (first.is_ok && second.is_unsupported_resource && - second.interface_state == HmiInterfaces::STATE_NOT_AVAILABLE) { - return true; - } - return false; -} - } // namespace bool ChangeRegistrationRequest::PrepareResponseParameters( @@ -323,8 +314,10 @@ bool ChangeRegistrationRequest::PrepareResponseParameters( if ((result && is_tts_or_ui_or_vr_unsupported)) { result_code = mobile_apis::Result::UNSUPPORTED_RESOURCE; - result = CheckResultCode(ui_properties_info, tts_properties_info) || - CheckResultCode(tts_properties_info, vr_properties_info); + result = + PrepareResultForMobileResponse(ui_properties_info, + tts_properties_info) && + PrepareResultForMobileResponse(tts_properties_info, vr_properties_info); } else { // If response contains erroneous result code SDL need return erroneus // result code. diff --git a/src/components/application_manager/test/commands/mobile/change_registration_test.cc b/src/components/application_manager/test/commands/mobile/change_registration_test.cc index 2a159af868..f454d51120 100644 --- a/src/components/application_manager/test/commands/mobile/change_registration_test.cc +++ b/src/components/application_manager/test/commands/mobile/change_registration_test.cc @@ -214,7 +214,7 @@ TEST_F(ChangeRegistrationRequestTest, OnEvent_VR_UNSUPPORTED_RESOURCE) { EXPECT_EQ( (*response_to_mobile)[strings::msg_params][strings::success].asBool(), - false); + true); EXPECT_EQ( (*response_to_mobile)[strings::msg_params][strings::result_code].asInt(), static_cast<int32_t>(mobile_apis::Result::UNSUPPORTED_RESOURCE)); |