diff options
4 files changed, 17 insertions, 7 deletions
diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc index bbf391a9f1..559b9c0035 100644 --- a/src/components/application_manager/src/policies/policy_handler.cc +++ b/src/components/application_manager/src/policies/policy_handler.cc @@ -1091,8 +1091,7 @@ bool PolicyHandler::ReceiveMessageFromSDK(const std::string& file, MessageHelper::CreateGetVehicleDataRequest( correlation_id, vehicle_data_args, application_manager_); } else { - LOG4CXX_WARN(logger_, "Exchange wasn't successful, trying another one."); - policy_manager_->ForcePTExchange(); + LOG4CXX_WARN(logger_, "Exchange wasn't successful"); } OnPTUFinished(ret); return ret; diff --git a/src/components/application_manager/test/policy_handler_test.cc b/src/components/application_manager/test/policy_handler_test.cc index 77500fd238..d9e1cefa01 100644 --- a/src/components/application_manager/test/policy_handler_test.cc +++ b/src/components/application_manager/test/policy_handler_test.cc @@ -408,7 +408,6 @@ TEST_F(PolicyHandlerTest, ReceiveMessageFromSDK_PTNotLoaded) { // Checks EXPECT_CALL(*mock_policy_manager_, LoadPT("", msg)).WillOnce(Return(false)); - EXPECT_CALL(*mock_policy_manager_, ForcePTExchange()).WillOnce(Return("")); EXPECT_CALL(app_manager_, GetNextHMICorrelationID()).Times(0); EXPECT_CALL(mock_message_helper_, CreateGetVehicleDataRequest(_, _, _)) .Times(0); diff --git a/src/components/policy/policy_external/src/policy_manager_impl.cc b/src/components/policy/policy_external/src/policy_manager_impl.cc index 2cd0d2b23b..aefd630b25 100644 --- a/src/components/policy/policy_external/src/policy_manager_impl.cc +++ b/src/components/policy/policy_external/src/policy_manager_impl.cc @@ -313,7 +313,10 @@ bool PolicyManagerImpl::LoadPT(const std::string& file, utils::SharedPtr<policy_table::Table> policy_table_snapshot = cache_->GenerateSnapshot(); if (!policy_table_snapshot) { - LOG4CXX_ERROR(logger_, "Failed to create snapshot of policy table"); + LOG4CXX_ERROR( + logger_, + "Failed to create snapshot of policy table, trying another exchange"); + ForcePTExchange(); return false; } @@ -327,7 +330,10 @@ bool PolicyManagerImpl::LoadPT(const std::string& file, // Replace current data with updated if (!cache_->ApplyUpdate(*pt_update)) { - LOG4CXX_WARN(logger_, "Unsuccessful save of updated policy table."); + LOG4CXX_WARN( + logger_, + "Unsuccessful save of updated policy table, trying another exchange"); + ForcePTExchange(); return false; } diff --git a/src/components/policy/policy_regular/src/policy_manager_impl.cc b/src/components/policy/policy_regular/src/policy_manager_impl.cc index 39b303cbb5..3e08147a4c 100644 --- a/src/components/policy/policy_regular/src/policy_manager_impl.cc +++ b/src/components/policy/policy_regular/src/policy_manager_impl.cc @@ -196,7 +196,10 @@ bool PolicyManagerImpl::LoadPT(const std::string& file, utils::SharedPtr<policy_table::Table> policy_table_snapshot = cache_->GenerateSnapshot(); if (!policy_table_snapshot) { - LOG4CXX_ERROR(logger_, "Failed to create snapshot of policy table"); + LOG4CXX_ERROR( + logger_, + "Failed to create snapshot of policy table, trying another exchange"); + ForcePTExchange(); return false; } @@ -209,7 +212,10 @@ bool PolicyManagerImpl::LoadPT(const std::string& file, // Replace current data with updated if (!cache_->ApplyUpdate(*pt_update)) { - LOG4CXX_WARN(logger_, "Unsuccessful save of updated policy table."); + LOG4CXX_WARN( + logger_, + "Unsuccessful save of updated policy table, trying another exchange"); + ForcePTExchange(); return false; } |