diff options
author | Ira Lytvynenko (GitHub) <ILytvynenko@luxoft.com> | 2019-10-21 17:11:08 +0300 |
---|---|---|
committer | Collin <iCollin@users.noreply.github.com> | 2019-10-21 10:11:08 -0400 |
commit | b67c088ea29cd0d7b29f4809a7964b11af80745e (patch) | |
tree | c0ef7a00006e296f32b2d27322a272ad83a7c866 | |
parent | 518df4697965ba6481932af3a9f77b1bd49487f0 (diff) | |
download | sdl_core-b67c088ea29cd0d7b29f4809a7964b11af80745e.tar.gz |
Check if there are any registered app before sending UPDATE_NEEDED (#3090)
-rw-r--r-- | src/components/policy/policy_external/src/policy_manager_impl.cc | 2 | ||||
-rw-r--r-- | src/components/policy/policy_external/test/policy_manager_impl_user_consent_test.cc | 2 |
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( |