summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJackLivio <jack@livio.io>2018-09-26 11:30:21 -0400
committerJackLivio <jack@livio.io>2018-09-26 11:30:21 -0400
commite96bdb37ff0f473dbe8c9450c38953dfde4ef584 (patch)
tree0aebf3719a71444d62b9000b617ca37d86de866c
parent461f76b129e998d4b60540491684c348dd5c27e2 (diff)
downloadsdl_core-fix/default_policies_request_types.tar.gz
Check if app is default policy for requestType and requestSubTypefix/default_policies_request_types
-rw-r--r--src/components/policy/policy_external/src/policy_manager_impl.cc14
1 files changed, 13 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 e93eea3969..cd9954db57 100644
--- a/src/components/policy/policy_external/src/policy_manager_impl.cc
+++ b/src/components/policy/policy_external/src/policy_manager_impl.cc
@@ -696,6 +696,8 @@ const std::vector<std::string> PolicyManagerImpl::GetAppRequestTypes(
if (kDeviceDisallowed ==
cache_->GetDeviceConsent(GetCurrentDeviceId(policy_app_id))) {
cache_->GetAppRequestTypes(kPreDataConsentId, request_types);
+ } else if (cache_->IsDefaultPolicy(policy_app_id)) {
+ cache_->GetAppRequestTypes(kDefaultId, request_types);
} else {
cache_->GetAppRequestTypes(policy_app_id, request_types);
}
@@ -705,19 +707,29 @@ const std::vector<std::string> PolicyManagerImpl::GetAppRequestTypes(
RequestType::State PolicyManagerImpl::GetAppRequestTypesState(
const std::string& policy_app_id) const {
LOG4CXX_AUTO_TRACE(logger_);
+ if (cache_->IsDefaultPolicy(policy_app_id)) {
+ return cache_->GetAppRequestTypesState(kDefaultId);
+ }
return cache_->GetAppRequestTypesState(policy_app_id);
}
RequestSubType::State PolicyManagerImpl::GetAppRequestSubTypesState(
const std::string& policy_app_id) const {
LOG4CXX_AUTO_TRACE(logger_);
+ if (cache_->IsDefaultPolicy(policy_app_id)) {
+ return cache_->GetAppRequestSubTypesState(kDefaultId);
+ }
return cache_->GetAppRequestSubTypesState(policy_app_id);
}
const std::vector<std::string> PolicyManagerImpl::GetAppRequestSubTypes(
const std::string& policy_app_id) const {
std::vector<std::string> request_subtypes;
- cache_->GetAppRequestSubTypes(policy_app_id, request_subtypes);
+ if (cache_->IsDefaultPolicy(policy_app_id)) {
+ cache_->GetAppRequestSubTypes(kDefaultId, request_subtypes);
+ } else {
+ cache_->GetAppRequestSubTypes(policy_app_id, request_subtypes);
+ }
return request_subtypes;
}