summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_manager_impl.h5
-rw-r--r--src/components/policy/policy_regular/src/policy_manager_impl.cc5
-rw-r--r--src/components/policy/policy_regular/test/policy_manager_impl_test.cc4
3 files changed, 8 insertions, 6 deletions
diff --git a/src/components/policy/policy_regular/include/policy/policy_manager_impl.h b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h
index 7ded424286..3ca9994a8a 100644
--- a/src/components/policy/policy_regular/include/policy/policy_manager_impl.h
+++ b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h
@@ -196,8 +196,8 @@ class PolicyManagerImpl : public PolicyManager {
return cache_;
}
- inline void SetWrongPtuUpdateReceived(const bool wrong_ptu_update) {
- wrong_ptu_update_received_ = wrong_ptu_update;
+ inline void SetSendOnUpdateSentOut(const bool send_on_update_sent_out) {
+ send_on_update_sent_out_ = send_on_update_sent_out;
}
#endif // BUILD_TESTS
virtual const std::vector<std::string> GetAppRequestTypes(
@@ -371,6 +371,7 @@ class PolicyManagerImpl : public PolicyManager {
RetrySequenceURL retry_sequence_url_;
bool wrong_ptu_update_received_;
+ bool send_on_update_sent_out_;
bool trigger_ptu_;
};
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 5f28d4405f..67b3feb070 100644
--- a/src/components/policy/policy_regular/src/policy_manager_impl.cc
+++ b/src/components/policy/policy_regular/src/policy_manager_impl.cc
@@ -79,6 +79,7 @@ PolicyManagerImpl::PolicyManagerImpl()
, ignition_check(true)
, retry_sequence_url_(0, 0, "")
, wrong_ptu_update_received_(false)
+ , send_on_update_sent_out_(false)
, trigger_ptu_(false) {
}
@@ -857,10 +858,10 @@ void PolicyManagerImpl::OnUpdateStarted() {
LOG4CXX_DEBUG(logger_,
"Update timeout will be set to (milisec): " << update_timeout);
- wrong_ptu_update_received_ =
+ send_on_update_sent_out_ =
!wrong_ptu_update_received_ && !update_status_manager_.IsUpdatePending();
- if (wrong_ptu_update_received_) {
+ if (send_on_update_sent_out_) {
update_status_manager_.OnUpdateSentOut(update_timeout);
}
cache_->SaveUpdateRequired(true);
diff --git a/src/components/policy/policy_regular/test/policy_manager_impl_test.cc b/src/components/policy/policy_regular/test/policy_manager_impl_test.cc
index 0d955d5c45..a8804236c7 100644
--- a/src/components/policy/policy_regular/test/policy_manager_impl_test.cc
+++ b/src/components/policy/policy_regular/test/policy_manager_impl_test.cc
@@ -462,7 +462,7 @@ TEST_F(PolicyManagerImplTest2, GetNotificationsNumberAfterPTUpdate) {
// Arrange
Json::Value table = CreatePTforLoad();
manager->ForcePTExchange();
- manager->SetWrongPtuUpdateReceived(false);
+ manager->SetSendOnUpdateSentOut(false);
manager->OnUpdateStarted();
policy_table::Table update(&table);
update.SetPolicyTableType(rpc::policy_table_interface_base::PT_UPDATE);
@@ -869,7 +869,7 @@ TEST_F(PolicyManagerImplTest2, ResetRetrySequence) {
CreateLocalPT("sdl_preloaded_pt.json");
manager->ResetRetrySequence();
EXPECT_EQ("UPDATE_NEEDED", manager->GetPolicyTableStatus());
- manager->SetWrongPtuUpdateReceived(false);
+ manager->SetSendOnUpdateSentOut(false);
manager->OnUpdateStarted();
EXPECT_EQ("UPDATING", manager->GetPolicyTableStatus());
}