summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjacobkeeler <jacob.keeler@livioradio.com>2020-12-11 14:26:38 -0500
committerjacobkeeler <jacob.keeler@livioradio.com>2020-12-11 14:26:38 -0500
commitbac986d1bb48e98330a27167235c47f10a617c23 (patch)
tree003914799148d56920c9b164a2237e05c944de06
parent2e5c3ab677e667d86304ee169d32fbd4215d70d0 (diff)
downloadsdl_core-fix/revoked_app_policy_fields.tar.gz
Check for revoked apps when reading mandatory policy fieldsfix/revoked_app_policy_fields
-rw-r--r--src/components/policy/policy_external/src/cache_manager.cc12
-rw-r--r--src/components/policy/policy_regular/src/cache_manager.cc3
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);
}