diff options
author | Jacob Keeler <jacob.keeler@livioradio.com> | 2020-12-16 12:01:29 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-16 12:01:29 -0500 |
commit | 8a307d91f79941eddae6dacfbff109d4cd10a7dc (patch) | |
tree | 8b854c03935b1beb52692df4d57f2faba55cda43 | |
parent | 04ced64614e550490e1eae4b866d5d70092a5450 (diff) | |
parent | bac986d1bb48e98330a27167235c47f10a617c23 (diff) | |
download | sdl_core-8a307d91f79941eddae6dacfbff109d4cd10a7dc.tar.gz |
Merge pull request #3598 from smartdevicelink/fix/revoked_app_policy_fields
Check for revoked apps when reading mandatory policy fields
-rw-r--r-- | src/components/policy/policy_external/src/cache_manager.cc | 12 | ||||
-rw-r--r-- | src/components/policy/policy_regular/src/cache_manager.cc | 3 |
2 files changed, 10 insertions, 5 deletions
diff --git a/src/components/policy/policy_external/src/cache_manager.cc b/src/components/policy/policy_external/src/cache_manager.cc index 81a5518cb8..1b5f668e9a 100644 --- a/src/components/policy/policy_external/src/cache_manager.cc +++ b/src/components/policy/policy_external/src/cache_manager.cc @@ -348,7 +348,8 @@ bool CacheManager::CanAppKeepContext(const std::string& app_id) const { bool result = false; if (kDeviceId == app_id) { result = pt_->policy_table.app_policies_section.device.keep_context; - } else if (IsApplicationRepresented(app_id)) { + } else if (IsApplicationRepresented(app_id) && + !IsApplicationRevoked(app_id)) { result = pt_->policy_table.app_policies_section.apps[app_id].keep_context; } return result; @@ -407,7 +408,8 @@ bool CacheManager::CanAppStealFocus(const std::string& app_id) const { bool result = false; if (kDeviceId == app_id) { result = pt_->policy_table.app_policies_section.device.steal_focus; - } else if (IsApplicationRepresented(app_id)) { + } else if (IsApplicationRepresented(app_id) && + !IsApplicationRevoked(app_id)) { result = pt_->policy_table.app_policies_section.apps[app_id].steal_focus; } return result; @@ -422,7 +424,8 @@ bool CacheManager::GetDefaultHMI(const std::string& app_id, if (kDeviceId == app_id) { default_hmi = EnumToJsonString( pt_->policy_table.app_policies_section.device.default_hmi); - } else if (IsApplicationRepresented(app_id)) { + } else if (IsApplicationRepresented(app_id) && + !IsApplicationRevoked(app_id)) { default_hmi = EnumToJsonString( pt_->policy_table.app_policies_section.apps[app_id].default_hmi); } @@ -1820,7 +1823,8 @@ bool CacheManager::GetPriority(const std::string& policy_app_id, policy_table::ApplicationPolicies::const_iterator policy_iter = policies.find(policy_app_id); - const bool app_id_exists = policies.end() != policy_iter; + const bool app_id_exists = + policies.end() != policy_iter && !IsApplicationRevoked(policy_app_id); if (app_id_exists) { priority = EnumToJsonString((*policy_iter).second.priority); } diff --git a/src/components/policy/policy_regular/src/cache_manager.cc b/src/components/policy/policy_regular/src/cache_manager.cc index 8f98996687..d53ec4d18a 100644 --- a/src/components/policy/policy_regular/src/cache_manager.cc +++ b/src/components/policy/policy_regular/src/cache_manager.cc @@ -1128,7 +1128,8 @@ bool CacheManager::GetPriority(const std::string& policy_app_id, policy_table::ApplicationPolicies::const_iterator policy_iter = policies.find(policy_app_id); - const bool app_id_exists = policies.end() != policy_iter; + const bool app_id_exists = + policies.end() != policy_iter && !IsApplicationRevoked(policy_app_id); if (app_id_exists) { priority = EnumToJsonString((*policy_iter).second.priority); } |