diff options
Diffstat (limited to 'src/components/policy/policy_external/include/policy')
4 files changed, 32 insertions, 2 deletions
diff --git a/src/components/policy/policy_external/include/policy/cache_manager.h b/src/components/policy/policy_external/include/policy/cache_manager.h index 428a9bd2f6..bda456c90a 100644 --- a/src/components/policy/policy_external/include/policy/cache_manager.h +++ b/src/components/policy/policy_external/include/policy/cache_manager.h @@ -701,6 +701,15 @@ class CacheManager : public CacheManagerInterface { const PolicySettings& get_settings() const; + /** + * @brief OnDeviceSwitching Processes existing policy permissions for devices + * switching transport + * @param device_id_from Device ID original + * @param device_id_to Device ID new + */ + void OnDeviceSwitching(const std::string& device_id_from, + const std::string& device_id_to) OVERRIDE; + private: std::string currentDateTime(); struct AppHMITypeToString { @@ -731,6 +740,13 @@ class CacheManager : public CacheManagerInterface { */ void ResetCalculatedPermissionsForDevice(const std::string& device_id); + /** + * @brief Transform to lower case all non default application names in + * applications policies section + * @param pt polict rable for update + */ + void MakeLowerCaseAppNames(policy_table::Table& pt) const; + void AddCalculatedPermissions(const std::string& device_id, const std::string& policy_app_id, const policy::Permissions& permissions); @@ -748,7 +764,7 @@ class CacheManager : public CacheManagerInterface { typedef std::set<std::string> UnpairedDevices; UnpairedDevices is_unpaired_; - sync_primitives::Lock cache_lock_; + mutable sync_primitives::Lock cache_lock_; sync_primitives::Lock unpaired_lock_; typedef std::map<std::string, Permissions> AppCalculatedPermissions; diff --git a/src/components/policy/policy_external/include/policy/cache_manager_interface.h b/src/components/policy/policy_external/include/policy/cache_manager_interface.h index ae1f8922ba..b9e9f73646 100644 --- a/src/components/policy/policy_external/include/policy/cache_manager_interface.h +++ b/src/components/policy/policy_external/include/policy/cache_manager_interface.h @@ -778,6 +778,15 @@ class CacheManagerInterface { virtual void SetExternalConsentForApp( const PermissionConsent& permissions) = 0; + /** + * @brief OnDeviceSwitching Processes existing policy permissions for devices + * switching transport + * @param device_id_from Device ID original + * @param device_id_to Device ID new + */ + virtual void OnDeviceSwitching(const std::string& device_id_from, + const std::string& device_id_to) = 0; + #ifdef BUILD_TESTS /** * @brief GetPT allows to obtain SharedPtr to PT. 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 80ceb06e7e..97a2e60055 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 @@ -559,6 +559,9 @@ class PolicyManagerImpl : public PolicyManager { */ void OnAppRegisteredOnMobile(const std::string& application_id) OVERRIDE; + void OnDeviceSwitching(const std::string& device_id_from, + const std::string& device_id_to) OVERRIDE; + /** * @brief Gets meta information * @return meta information 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 f57919b6f7..232191cfea 100644 --- a/src/components/policy/policy_external/include/policy/policy_types.h +++ b/src/components/policy/policy_external/include/policy/policy_types.h @@ -41,6 +41,8 @@ #include <utility> #include "utils/shared_ptr.h" #include "utils/helpers.h" +#include "transport_manager/common.h" + namespace policy { // TODO(PV): specify errors @@ -190,7 +192,7 @@ struct DeviceParams { std::string device_name; std::string device_mac_address; std::string device_connection_type; - uint32_t device_handle; + transport_manager::DeviceHandle device_handle; }; /** |