summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsniukalov <sniukaov@luxoft.com>2020-02-07 19:18:42 +0200
committersniukalov <sniukaov@luxoft.com>2020-02-10 16:55:06 +0200
commitff498abb5b0ee30a68d89bb9696a1254eb05102d (patch)
treea71d281421b45704fe693f040798732f91a4c4b2
parent493a706079e29071db3452a0237a1cabdccdf230 (diff)
downloadsdl_core-ff498abb5b0ee30a68d89bb9696a1254eb05102d.tar.gz
Update functionality
-rw-r--r--src/components/policy/policy_external/include/policy/update_status_manager.h1
-rw-r--r--src/components/policy/policy_external/src/policy_manager_impl.cc1
-rw-r--r--src/components/policy/policy_external/src/status.cc3
-rw-r--r--src/components/policy/policy_external/src/update_status_manager.cc8
4 files changed, 9 insertions, 4 deletions
diff --git a/src/components/policy/policy_external/include/policy/update_status_manager.h b/src/components/policy/policy_external/include/policy/update_status_manager.h
index 2ca19a4d67..018bab7f99 100644
--- a/src/components/policy/policy_external/include/policy/update_status_manager.h
+++ b/src/components/policy/policy_external/include/policy/update_status_manager.h
@@ -228,6 +228,7 @@ class UpdateStatusManager {
UpdateEvent last_processed_event_;
bool apps_search_in_progress_;
bool app_registered_from_non_consented_device_;
+ bool last_update_was_failed_;
sync_primitives::Lock apps_search_in_progress_lock_;
class UpdateThreadDelegate : public threads::ThreadDelegate {
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 d241ca4a39..25a401109f 100644
--- a/src/components/policy/policy_external/src/policy_manager_impl.cc
+++ b/src/components/policy/policy_external/src/policy_manager_impl.cc
@@ -1401,6 +1401,7 @@ void PolicyManagerImpl::RetrySequenceFailed() {
StartPTExchange();
}
is_ptu_in_progress_ = false;
+ ptu_requested_ = false;
}
void PolicyManagerImpl::ResetTimeout() {
diff --git a/src/components/policy/policy_external/src/status.cc b/src/components/policy/policy_external/src/status.cc
index 12772c47ce..af7958a3dd 100644
--- a/src/components/policy/policy_external/src/status.cc
+++ b/src/components/policy/policy_external/src/status.cc
@@ -124,9 +124,6 @@ void policy::UpdatingStatus::ProcessEvent(policy::UpdateStatusManager* manager,
case kOnResetPolicyTableNoUpdate:
manager->SetNextStatus(std::make_shared<UpToDateStatus>());
break;
- case kOnNewAppRegistered:
- manager->SetPostponedStatus(std::make_shared<UpdateNeededStatus>());
- break;
case kOnWrongUpdateReceived:
case kOnUpdateTimeout:
manager->SetNextStatus(std::make_shared<UpdateNeededStatus>());
diff --git a/src/components/policy/policy_external/src/update_status_manager.cc b/src/components/policy/policy_external/src/update_status_manager.cc
index fc6e93f3b7..ccf8b6510c 100644
--- a/src/components/policy/policy_external/src/update_status_manager.cc
+++ b/src/components/policy/policy_external/src/update_status_manager.cc
@@ -44,7 +44,8 @@ UpdateStatusManager::UpdateStatusManager()
, current_status_(std::make_shared<UpToDateStatus>())
, last_processed_event_(kNoEvent)
, apps_search_in_progress_(false)
- , app_registered_from_non_consented_device_(true) {
+ , app_registered_from_non_consented_device_(true)
+ , last_update_was_failed_(false) {
update_status_thread_delegate_ = new UpdateThreadDelegate(this);
thread_ = threads::CreateThread("UpdateStatusThread",
update_status_thread_delegate_);
@@ -136,6 +137,7 @@ void UpdateStatusManager::OnResetDefaultPT(bool is_update_required) {
void UpdateStatusManager::OnResetRetrySequence() {
LOG4CXX_AUTO_TRACE(logger_);
+ last_update_was_failed_ = true;
ProcessEvent(kOnResetRetrySequence);
}
@@ -157,6 +159,10 @@ void UpdateStatusManager::OnNewApplicationAdded(const DeviceConsent consent) {
}
LOG4CXX_DEBUG(logger_, "Application registered from consented device");
app_registered_from_non_consented_device_ = false;
+ if (last_update_was_failed_) {
+ last_update_was_failed_ = false;
+ ProcessEvent(kUpdateForNextInQueue);
+ }
ProcessEvent(kOnNewAppRegistered);
}