From b51affe9d89655c5b3bc5199f030bf2bc1eb190c Mon Sep 17 00:00:00 2001 From: Shobhit Adlakha Date: Thu, 19 Mar 2020 13:41:25 -0400 Subject: Fix/Checking PTU triggers when no apps are registered in regular policy mode (#3294) * Trigger PTExchange when Device consent is enabled * Move StartPTExchange call to BC.OnReady * StartPTExchange is a protected function. Add TriggerPTUIfNeeded to the policy_manager as well * Fixed GetPolicyHandler call in BC.OnReady * Add mock definitions * Fix failed ut * Handle PolicyUpdate error response * Add reset retry sequence * Revert "Move StartPTExchange call to BC.OnReady" This reverts commit 7c53978b2e7a42ed51cb856d054dce88e040e8ea. Co-authored-by: JackLivio --- src/components/policy/policy_regular/src/policy_manager_impl.cc | 3 +++ 1 file changed, 3 insertions(+) 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 b3354500e8..8d4db9e675 100644 --- a/src/components/policy/policy_regular/src/policy_manager_impl.cc +++ b/src/components/policy/policy_regular/src/policy_manager_impl.cc @@ -926,6 +926,9 @@ void PolicyManagerImpl::SetUserConsentForDevice(const std::string& device_id, DeviceConsent current_consent = GetUserConsentForDevice(device_id); bool is_current_device_allowed = DeviceConsent::kDeviceAllowed == current_consent ? true : false; + if (is_allowed) { + StartPTExchange(); + } if (DeviceConsent::kDeviceHasNoConsent != current_consent && is_current_device_allowed == is_allowed) { const std::string consent = is_allowed ? "allowed" : "disallowed"; -- cgit v1.2.1