diff options
Diffstat (limited to 'src/components/policy/policy_external/include')
3 files changed, 55 insertions, 2 deletions
diff --git a/src/components/policy/policy_external/include/policy/policy_helper.h b/src/components/policy/policy_external/include/policy/policy_helper.h index 42c1ec0b46..6945f45b45 100644 --- a/src/components/policy/policy_external/include/policy/policy_helper.h +++ b/src/components/policy/policy_external/include/policy/policy_helper.h @@ -199,6 +199,23 @@ struct CheckAppPolicy { CheckAppPolicyResults& out_results_; }; +/** + * @brief Helper struct for filling actions to be done for processed application + * using CheckAppPolicyResults data as a source + */ +struct FillActionsForAppPolicies { + FillActionsForAppPolicies( + ApplicationsPoliciesActions& actions, + const policy_table::ApplicationPolicies& app_policies) + : actions_(actions), app_policies_(app_policies) {} + + void operator()(const policy::CheckAppPolicyResults::value_type& value); + + private: + ApplicationsPoliciesActions& actions_; + const policy_table::ApplicationPolicies& app_policies_; +}; + /* * @brief Fill permissions data with merged rpc permissions for hmi levels and * parameters diff --git a/src/components/policy/policy_external/include/policy/policy_manager_impl.h b/src/components/policy/policy_external/include/policy/policy_manager_impl.h index f8d226c86a..80ceb06e7e 100644 --- a/src/components/policy/policy_external/include/policy/policy_manager_impl.h +++ b/src/components/policy/policy_external/include/policy/policy_manager_impl.h @@ -719,8 +719,9 @@ class PolicyManagerImpl : public PolicyManager { /** * @brief Processes results from policy table update analysis done by - * CheckPermissionsChanges() by sending OnPermissionChange and - * OnAppPermissionChanged notifications + * CheckPermissionsChanges() by filling ApplicationsPoliciesActions struct + * with actions which should be done for every application and passes them to + * ProcessActionsForAppPolicies() * @param results Collection of per-application results * @param app_policies Reference to updated application policies section as * a data source for generating notifications data @@ -730,6 +731,19 @@ class PolicyManagerImpl : public PolicyManager { const policy_table::ApplicationPolicies& app_policies); /** + * @brief Processes actions filled in ProcessAppPolicyCheckResults() for every + * application by sending OnPermissionChange and OnAppPermissionChanged + * notifications and by checking consent where it needed + * @param actions Reference to map with actions to be done or not for every + * application + * @param app_policies Reference to updated application policies section as + * a data source for generating notifications data + */ + void ProcessActionsForAppPolicies( + const ApplicationsPoliciesActions& actions, + const policy_table::ApplicationPolicies& app_policies); + + /** * @brief Fill structure to be sent with OnPermissionsChanged notification * * @param Policy table struct, which contains rpc functional groups data diff --git a/src/components/policy/policy_external/include/policy/policy_types.h b/src/components/policy/policy_external/include/policy/policy_types.h index 9ba1a1cfff..f57919b6f7 100644 --- a/src/components/policy/policy_external/include/policy/policy_types.h +++ b/src/components/policy/policy_external/include/policy/policy_types.h @@ -432,6 +432,28 @@ struct ExternalConsentStatusItemSorter { }; /** + * @brief The ApplicationPolicyActions struct contains actions which should be + * done for some application + */ +struct ApplicationPolicyActions { + ApplicationPolicyActions() + : is_notify_system(false) + , is_send_permissions_to_app(false) + , is_consent_needed(false) {} + + bool is_notify_system; + bool is_send_permissions_to_app; + bool is_consent_needed; +}; + +/** + * @brief ApplicationsPoliciesActions map of actions to be done for every + * application + */ +typedef std::map<std::string, ApplicationPolicyActions> + ApplicationsPoliciesActions; + +/** * @brief Customer connectivity settings status */ typedef std::set<ExternalConsentStatusItem, ExternalConsentStatusItemSorter> |