summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLitvinenkoIra <ilytvynenko@luxoft.com>2019-09-24 17:12:15 +0300
committerLitvinenkoIra <ilytvynenko@luxoft.com>2019-10-18 10:57:06 +0300
commitacb0db8dbfe41588a3389248a6aff58cd93a4943 (patch)
treec0ef7a00006e296f32b2d27322a272ad83a7c866
parent518df4697965ba6481932af3a9f77b1bd49487f0 (diff)
downloadsdl_core-fix/update_needed_sending.tar.gz
Check if there are any registered app before sending UPDATE_NEEDEDfix/update_needed_sending
-rw-r--r--src/components/policy/policy_external/src/policy_manager_impl.cc2
-rw-r--r--src/components/policy/policy_external/test/policy_manager_impl_user_consent_test.cc2
2 files changed, 3 insertions, 1 deletions
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 2d8df07271..b9eed0be4e 100644
--- a/src/components/policy/policy_external/src/policy_manager_impl.cc
+++ b/src/components/policy/policy_external/src/policy_manager_impl.cc
@@ -1125,7 +1125,7 @@ void PolicyManagerImpl::SetUserConsentForDevice(const std::string& device_id,
"Event listener is not initialized. "
"Can't call OnDeviceConsentChanged");
}
- if (is_allowed) {
+ if (is_allowed && listener_->CanUpdate()) {
update_status_manager_.OnDeviceConsented();
}
StartPTExchange();
diff --git a/src/components/policy/policy_external/test/policy_manager_impl_user_consent_test.cc b/src/components/policy/policy_external/test/policy_manager_impl_user_consent_test.cc
index e42ecbacd7..1db23260a8 100644
--- a/src/components/policy/policy_external/test/policy_manager_impl_user_consent_test.cc
+++ b/src/components/policy/policy_external/test/policy_manager_impl_user_consent_test.cc
@@ -53,6 +53,8 @@ TEST_F(
EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(_, app_id_1_))
.WillRepeatedly(Return(device_id_1_));
+ EXPECT_CALL(listener_, CanUpdate()).WillRepeatedly(Return(true));
+
policy_manager_->SetUserConsentForDevice(device_id_1_, true);
policy_manager_->AddApplication(