summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Oleynik <AOleynik@luxoft.com>2014-09-13 16:09:45 +0300
committerAndrey Oleynik <AOleynik@luxoft.com>2014-09-13 16:09:45 +0300
commit0351536f88194bafe6926ee384f69ac0706a5bf5 (patch)
tree82565a1bc14b7f5d64c0d5856d0f357231049893
parent992e1d1ab9efe6e75440fe80d8393ae7cf83923b (diff)
downloadsdl_core-0351536f88194bafe6926ee384f69ac0706a5bf5.tar.gz
APPLINK-9232. Fixed empty items in OnPermissionsChanged notification for GENIVI.
-rw-r--r--src/components/policy/src/policy/src/cache_manager.cc10
-rw-r--r--src/components/policy/src/policy/src/policy_manager_impl.cc12
2 files changed, 10 insertions, 12 deletions
diff --git a/src/components/policy/src/policy/src/cache_manager.cc b/src/components/policy/src/policy/src/cache_manager.cc
index 0d9c396ece..5d0a8bfc39 100644
--- a/src/components/policy/src/policy/src/cache_manager.cc
+++ b/src/components/policy/src/policy/src/cache_manager.cc
@@ -149,7 +149,6 @@ void CacheManager::GetAllAppGroups(const std::string& app_id,
FunctionalGroupIDs& all_group_ids) {
LOG4CXX_TRACE_ENTER(logger_);
-#ifdef EXTENDED_POLICY
policy_table::ApplicationPolicies::const_iterator app_params_iter =
pt_->policy_table.app_policies.find(app_id);
@@ -165,7 +164,6 @@ void CacheManager::GetAllAppGroups(const std::string& app_id,
all_group_ids.push_back(group_id);
}
}
-#endif // EXTENDED_POLICY
LOG4CXX_TRACE_EXIT(logger_);
}
@@ -295,15 +293,15 @@ bool CacheManager::GetPermissionsForApp(const std::string &device_id,
FunctionalIdType& group_types) {
LOG4CXX_TRACE_ENTER(logger_);
-#ifdef EXTENDED_POLICY
GetAllAppGroups(app_id, group_types[kTypeGeneral]);
- GetPreConsentedGroups(app_id, group_types[kTypePreconsented]);
GetAllAppGroups(kDefaultId, group_types[kTypeDefault]);
+ GetAllAppGroups(kPreDataConsentId, group_types[kTypePreDataConsented]);
+#ifdef EXTENDED_POLICY
+ GetPreConsentedGroups(app_id, group_types[kTypePreconsented]);
GetConsentedGroups(device_id, app_id,
group_types[kTypeAllowed], group_types[kTypeDisallowed]);
- GetAllAppGroups(kPreDataConsentId, group_types[kTypePreDataConsented]);
GetAllAppGroups(kDeviceId, group_types[kTypeDevice]);
#endif // EXTENDED_POLICY
LOG4CXX_TRACE_EXIT(logger_);
@@ -848,7 +846,6 @@ bool CacheManager::SetSystemLanguage(const std::string &language) {
bool CacheManager::GetFunctionalGroupNames(FunctionalGroupNames &names) {
LOG4CXX_TRACE_ENTER(logger_);
-#ifdef EXTENDED_POLICY
rpc::policy_table_interface_base::FunctionalGroupings::iterator iter =
pt_->policy_table.functional_groupings.begin();
rpc::policy_table_interface_base::FunctionalGroupings::iterator iter_end =
@@ -861,7 +858,6 @@ bool CacheManager::GetFunctionalGroupNames(FunctionalGroupNames &names) {
names.insert(std::pair<uint32_t, std::pair<std::string, std::string> >(id, value));
}
-#endif // EXTENDED_POLICY
LOG4CXX_TRACE_EXIT(logger_);
return true;
}
diff --git a/src/components/policy/src/policy/src/policy_manager_impl.cc b/src/components/policy/src/policy/src/policy_manager_impl.cc
index 60059c057c..508e8216cf 100644
--- a/src/components/policy/src/policy/src/policy_manager_impl.cc
+++ b/src/components/policy/src/policy/src/policy_manager_impl.cc
@@ -792,7 +792,6 @@ void PolicyManagerImpl::GetPermissionsForApp(
const std::string& device_id, const std::string& policy_app_id,
std::vector<FunctionalGroupPermission>& permissions) {
LOG4CXX_INFO(logger_, "GetPermissionsForApp");
-#ifdef EXTENDED_POLICY
std::string app_id_to_check = policy_app_id;
bool allowed_by_default = false;
@@ -837,6 +836,7 @@ void PolicyManagerImpl::GetPermissionsForApp(
// All groups for specific application
FunctionalGroupIDs all_groups = group_types[kTypeGeneral];
+#ifdef EXTENDED_POLICY
// Groups assigned by the user for specific application
FunctionalGroupIDs allowed_groups = group_types[kTypeAllowed];
@@ -875,12 +875,14 @@ void PolicyManagerImpl::GetPermissionsForApp(
kGroupAllowed, permissions);
FillFunctionalGroupPermissions(common_disallowed, group_names,
kGroupDisallowed, permissions);
- }
- return;
#else
- // For basic policy
- permissions = std::vector<FunctionalGroupPermission>();
+ // In case of GENIVI all groups are allowed
+ FunctionalGroupIDs common_allowed = all_groups;
+ FillFunctionalGroupPermissions(common_allowed, group_names,
+ kGroupAllowed, permissions);
#endif
+ }
+ return;
}
std::string& PolicyManagerImpl::GetCurrentDeviceId(