summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjacobkeeler <jacob.keeler@livioradio.com>2018-04-05 14:18:49 -0400
committerjacobkeeler <jacob.keeler@livioradio.com>2018-04-09 14:07:24 -0400
commite15e3537c9fa898b6e6142ff01e75d23391f959a (patch)
tree634e014ae656b99a2bfaeef33c4621934a8aef70
parent61fd83fed0dc584019b305bebc82512d2c42b9e7 (diff)
downloadsdl_core-hotfix/invalid_ptu_loop.tar.gz
Don't force a PTU when an invalid PT is receivedhotfix/invalid_ptu_loop
-rw-r--r--src/components/application_manager/src/policies/policy_handler.cc3
-rw-r--r--src/components/application_manager/test/policy_handler_test.cc1
-rw-r--r--src/components/policy/policy_external/src/policy_manager_impl.cc10
-rw-r--r--src/components/policy/policy_regular/src/policy_manager_impl.cc10
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;
}