summaryrefslogtreecommitdiff
path: root/src/components/policy/policy_external/src/update_status_manager.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/policy/policy_external/src/update_status_manager.cc')
-rw-r--r--src/components/policy/policy_external/src/update_status_manager.cc27
1 files changed, 14 insertions, 13 deletions
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 087db1149b..b352b5ea39 100644
--- a/src/components/policy/policy_external/src/update_status_manager.cc
+++ b/src/components/policy/policy_external/src/update_status_manager.cc
@@ -33,7 +33,6 @@
#include "policy/update_status_manager.h"
#include "policy/policy_listener.h"
#include "utils/logger.h"
-#include "utils/make_shared.h"
namespace policy {
@@ -41,7 +40,7 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "Policy")
UpdateStatusManager::UpdateStatusManager()
: listener_(NULL)
- , current_status_(utils::MakeShared<UpToDateStatus>())
+ , current_status_(std::make_shared<UpToDateStatus>())
, last_processed_event_(kNoEvent)
, apps_search_in_progress_(false)
, app_registered_from_non_consented_device_(true) {
@@ -67,11 +66,11 @@ void UpdateStatusManager::ProcessEvent(UpdateEvent event) {
DoTransition();
}
-void UpdateStatusManager::SetNextStatus(utils::SharedPtr<Status> status) {
+void UpdateStatusManager::SetNextStatus(std::shared_ptr<Status> status) {
next_status_ = status;
}
-void UpdateStatusManager::SetPostponedStatus(utils::SharedPtr<Status> status) {
+void UpdateStatusManager::SetPostponedStatus(std::shared_ptr<Status> status) {
postponed_status_ = status;
}
@@ -119,24 +118,27 @@ void UpdateStatusManager::OnResetRetrySequence() {
ProcessEvent(kOnResetRetrySequence);
}
+void UpdateStatusManager::OnExistedApplicationAdded(
+ const bool is_update_required) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (is_update_required) {
+ current_status_.reset(new UpToDateStatus());
+ ProcessEvent(kScheduleUpdate);
+ }
+}
+
void UpdateStatusManager::OnNewApplicationAdded(const DeviceConsent consent) {
LOG4CXX_AUTO_TRACE(logger_);
if (kDeviceAllowed != consent) {
+ LOG4CXX_DEBUG(logger_, "Application registered from non-consented device");
app_registered_from_non_consented_device_ = true;
return;
}
+ LOG4CXX_DEBUG(logger_, "Application registered from consented device");
app_registered_from_non_consented_device_ = false;
ProcessEvent(kOnNewAppRegistered);
}
-void UpdateStatusManager::OnPolicyInit(bool is_update_required) {
- LOG4CXX_AUTO_TRACE(logger_);
- if (is_update_required) {
- current_status_.reset(new UpToDateStatus());
- ProcessEvent(kScheduleUpdate);
- }
-}
-
void UpdateStatusManager::OnDeviceConsented() {
LOG4CXX_AUTO_TRACE(logger_);
if (app_registered_from_non_consented_device_) {
@@ -210,7 +212,6 @@ UpdateStatusManager::UpdateThreadDelegate::UpdateThreadDelegate(
UpdateStatusManager* update_status_manager)
: timeout_(0)
, stop_flag_(false)
- , state_lock_(true)
, update_status_manager_(update_status_manager) {
LOG4CXX_AUTO_TRACE(logger_);
LOG4CXX_DEBUG(logger_, "Create UpdateThreadDelegate");