diff options
Diffstat (limited to 'src/components/policy')
59 files changed, 485 insertions, 484 deletions
diff --git a/src/components/policy/policy_external/include/policy/access_remote.h b/src/components/policy/policy_external/include/policy/access_remote.h index fd185af075..eadef088ad 100644 --- a/src/components/policy/policy_external/include/policy/access_remote.h +++ b/src/components/policy/policy_external/include/policy/access_remote.h @@ -32,9 +32,9 @@ #ifndef SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_ACCESS_REMOTE_H_ #define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_ACCESS_REMOTE_H_ -#include <vector> #include <ostream> #include <string> +#include <vector> #include "policy/policy_table/types.h" #include "policy/policy_types.h" 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 2c35b2a378..15eb51565d 100644 --- a/src/components/policy/policy_external/include/policy/cache_manager.h +++ b/src/components/policy/policy_external/include/policy/cache_manager.h @@ -35,15 +35,15 @@ #include <map> -#include "policy/pt_representation.h" +#include "policy/cache_manager_interface.h" #include "policy/pt_ext_representation.h" +#include "policy/pt_representation.h" #include "policy/usage_statistics/statistics_manager.h" -#include "policy/cache_manager_interface.h" #include "utils/threads/thread.h" #include "utils/threads/thread_delegate.h" -#include "utils/lock.h" #include "utils/conditional_variable.h" +#include "utils/lock.h" namespace policy { class PolicySettings; @@ -256,7 +256,7 @@ class CacheManager : public CacheManagerInterface { * @brief Check if an app can send unknown rpc requests to an app service * provider * @param policy_app_id Unique application id - */ + */ virtual bool UnknownRPCPassthroughAllowed( const std::string& policy_app_id) const; @@ -798,35 +798,36 @@ class CacheManager : public CacheManagerInterface { ExternalConsentStatus GetExternalConsentEntities() OVERRIDE; /** - * @brief Creates collection of ExternalConsent items known by current - * functional - * groupings and appropiate section - * (disallowed_by_external_consent_entities_on/off) where - * is item is being holded. If item is not found it's not included into - * collection - * @param status Current status containing collection of ExternalConsent items - * @return Collection of ExternalConsent items mapped to list of groups with - * section - * marker where the item is found - */ + * @brief Creates collection of ExternalConsent items known by current + * functional + * groupings and appropiate section + * (disallowed_by_external_consent_entities_on/off) where + * is item is being holded. If item is not found it's not included into + * collection + * @param status Current status containing collection of ExternalConsent items + * @return Collection of ExternalConsent items mapped to list of groups with + * section + * marker where the item is found + */ GroupsByExternalConsentStatus GetGroupsWithSameEntities( const ExternalConsentStatus& status) OVERRIDE; /** - * @brief Gets collection of links device-to-application from device_data - * section of policy table if there any application records present, i.e. if - * any specific user consent is present - * @return Collection of device-to-application links - */ + * @brief Gets collection of links device-to-application from device_data + * section of policy table if there any application records present, i.e. if + * any specific user consent is present + * @return Collection of device-to-application links + */ std::map<std::string, std::string> GetKnownLinksFromPT() OVERRIDE; /** - * @brief Sets groups permissions affected by customer connectivity settings - * entities status, i.e. groups assigned to particular application on - * particular device which have same entities as current ExternalConsent status - * @param permissions Groups permissions which result current ExternalConsent - * status - */ + * @brief Sets groups permissions affected by customer connectivity settings + * entities status, i.e. groups assigned to particular application on + * particular device which have same entities as current ExternalConsent + * status + * @param permissions Groups permissions which result current ExternalConsent + * status + */ void SetExternalConsentForApp(const PermissionConsent& permissions) OVERRIDE; #ifdef BUILD_TESTS 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 6465c79c05..980ad42dcd 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 @@ -39,9 +39,9 @@ #include "policy/policy_table/types.h" #include "policy/pt_representation.h" -#include "policy/usage_statistics/counter.h" -#include "policy/policy_types.h" #include "policy/policy_settings.h" +#include "policy/policy_types.h" +#include "policy/usage_statistics/counter.h" namespace policy_table = rpc::policy_table_interface_base; @@ -199,11 +199,11 @@ class CacheManagerInterface { std::string& hybrid_app_preference) const = 0; /** - * Initializes a new cloud application with default policies - * Then adds cloud specific policies - * @param app_id application id - * @return true if success - */ + * Initializes a new cloud application with default policies + * Then adds cloud specific policies + * @param app_id application id + * @return true if success + */ virtual void InitCloudApp(const std::string& policy_app_id) = 0; /** @@ -265,7 +265,7 @@ class CacheManagerInterface { * @brief Check if an app can send unknown rpc requests to an app service * provider * @param policy_app_id Unique application id - */ + */ virtual bool UnknownRPCPassthroughAllowed( const std::string& policy_app_id) const = 0; @@ -867,9 +867,9 @@ class CacheManagerInterface { virtual std::string GetCertificate() const = 0; /** - * @brief Sets decrypted certificate in policy table - * @param certificate content of certificate - */ + * @brief Sets decrypted certificate in policy table + * @param certificate content of certificate + */ virtual void SetDecryptedCertificate(const std::string& certificate) = 0; /** @@ -894,34 +894,35 @@ class CacheManagerInterface { virtual ExternalConsentStatus GetExternalConsentEntities() = 0; /** - * @brief Creates collection of ExternalConsent items known by current - * functional - * groupings and appropiate section - * (disallowed_by_external_consent_entities_on/off) where - * is item is being holded - * @param status Current status containing collection of ExternalConsent items - * @return Collection of ExternalConsent items mapped to list of groups with - * section - * marker where the item is found - */ + * @brief Creates collection of ExternalConsent items known by current + * functional + * groupings and appropiate section + * (disallowed_by_external_consent_entities_on/off) where + * is item is being holded + * @param status Current status containing collection of ExternalConsent items + * @return Collection of ExternalConsent items mapped to list of groups with + * section + * marker where the item is found + */ virtual GroupsByExternalConsentStatus GetGroupsWithSameEntities( const ExternalConsentStatus& status) = 0; /** - * @brief Gets collection of links device-to-application from device_data - * section of policy table if there any application records present, i.e. if - * any specific user consent is present - * @return Collection of device-to-application links - */ + * @brief Gets collection of links device-to-application from device_data + * section of policy table if there any application records present, i.e. if + * any specific user consent is present + * @return Collection of device-to-application links + */ virtual std::map<std::string, std::string> GetKnownLinksFromPT() = 0; /** - * @brief Sets groups permissions affected by customer connectivity settings - * entities status, i.e. groups assigned to particular application on - * particular device which have same entities as current ExternalConsent status - * @param permissions Groups permissions which result current ExternalConsent - * status - */ + * @brief Sets groups permissions affected by customer connectivity settings + * entities status, i.e. groups assigned to particular application on + * particular device which have same entities as current ExternalConsent + * status + * @param permissions Groups permissions which result current ExternalConsent + * status + */ virtual void SetExternalConsentForApp( const PermissionConsent& permissions) = 0; 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 e3cb509c15..bce2559431 100644 --- a/src/components/policy/policy_external/include/policy/policy_helper.h +++ b/src/components/policy/policy_external/include/policy/policy_helper.h @@ -243,13 +243,13 @@ struct FillActionsForAppPolicies { */ struct FillNotificationData { /** - * @brief Constructor - * @param data Output structure with filled data - * @param group_state Consent of the group processed by instance - * @param undefined_group_consent Defines how to treat 'undefined' consent - * @param does_require_user_consent Specifies whether processed group requires - * user consent - */ + * @brief Constructor + * @param data Output structure with filled data + * @param group_state Consent of the group processed by instance + * @param undefined_group_consent Defines how to treat 'undefined' consent + * @param does_require_user_consent Specifies whether processed group requires + * user consent + */ FillNotificationData(Permissions& data, GroupConsent group_state, GroupConsent undefined_group_consent, 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 8a2e5b93f5..2f8f6cf070 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 @@ -35,15 +35,15 @@ #include <list> -#include "utils/lock.h" +#include "policy/access_remote.h" +#include "policy/access_remote_impl.h" +#include "policy/cache_manager_interface.h" #include "policy/policy_manager.h" #include "policy/policy_table.h" -#include "policy/cache_manager_interface.h" -#include "policy/update_status_manager.h" #include "policy/policy_table/functions.h" +#include "policy/update_status_manager.h" #include "policy/usage_statistics/statistics_manager.h" -#include "policy/access_remote.h" -#include "policy/access_remote_impl.h" +#include "utils/lock.h" namespace policy_table = rpc::policy_table_interface_base; @@ -542,10 +542,10 @@ class PolicyManagerImpl : public PolicyManager { void OnAppsSearchCompleted(const bool trigger_ptu) OVERRIDE; /** - * @brief Get state of request types for given application - * @param policy_app_id Unique application id - * @return request type state - */ + * @brief Get state of request types for given application + * @param policy_app_id Unique application id + * @return request type state + */ RequestType::State GetAppRequestTypesState( const std::string& policy_app_id) const OVERRIDE; @@ -566,10 +566,10 @@ class PolicyManagerImpl : public PolicyManager { const std::string policy_app_id) const OVERRIDE; /** - * @brief Gets request subtypes for application - * @param policy_app_id Unique application id - * @return request subtypes of application - */ + * @brief Gets request subtypes for application + * @param policy_app_id Unique application id + * @return request subtypes of application + */ const std::vector<std::string> GetAppRequestSubTypes( const std::string& policy_app_id) const OVERRIDE; @@ -677,7 +677,7 @@ class PolicyManagerImpl : public PolicyManager { * provider * @param policy_app_id Unique application id * @return bool true if allowed - */ + */ bool UnknownRPCPassthroughAllowed( const std::string& policy_app_id) const OVERRIDE; @@ -1009,11 +1009,11 @@ class PolicyManagerImpl : public PolicyManager { void SendAuthTokenUpdated(const std::string policy_app_id); /** - * @brief Gets all allowed module types - * @param policy_app_id unique identifier of application - * @param modules list of allowed module types - * @return true if application has allowed modules - */ + * @brief Gets all allowed module types + * @param policy_app_id unique identifier of application + * @param modules list of allowed module types + * @return true if application has allowed modules + */ bool GetModuleTypes(const std::string& policy_app_id, std::vector<std::string>* modules) const OVERRIDE; diff --git a/src/components/policy/policy_external/include/policy/policy_table.h b/src/components/policy/policy_external/include/policy/policy_table.h index fe27f1cb57..8f0d5f7efb 100644 --- a/src/components/policy/policy_external/include/policy/policy_table.h +++ b/src/components/policy/policy_external/include/policy/policy_table.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_TABLE_H_ #define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_TABLE_H_ -#include "policy/pt_representation.h" #include "policy/pt_ext_representation.h" +#include "policy/pt_representation.h" namespace policy { 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 84d9376a93..7247995f48 100644 --- a/src/components/policy/policy_external/include/policy/policy_types.h +++ b/src/components/policy/policy_external/include/policy/policy_types.h @@ -34,15 +34,15 @@ #define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_TYPES_H_ #include <algorithm> -#include <string> -#include <vector> #include <map> +#include <memory> #include <set> +#include <string> #include <utility> -#include <memory> +#include <vector> -#include "utils/helpers.h" #include "transport_manager/common.h" +#include "utils/helpers.h" namespace policy { @@ -119,10 +119,10 @@ typedef std::vector<std::string> StringArray; enum PermitResult { kRpcAllowed = 0, kRpcDisallowed, kRpcUserDisallowed }; /** - * @struct Stores result of check: - * if HMI Level was allowed for RPC to work in - * and list of parameters allowed for RPC if specified in PT. - */ + * @struct Stores result of check: + * if HMI Level was allowed for RPC to work in + * and list of parameters allowed for RPC if specified in PT. + */ struct CheckPermissionResult { CheckPermissionResult() : hmi_level_permitted(kRpcDisallowed) {} diff --git a/src/components/policy/policy_external/include/policy/pt_ext_representation.h b/src/components/policy/policy_external/include/policy/pt_ext_representation.h index 0aa284b707..f03947268a 100644 --- a/src/components/policy/policy_external/include/policy/pt_ext_representation.h +++ b/src/components/policy/policy_external/include/policy/pt_ext_representation.h @@ -280,10 +280,10 @@ class PTExtRepresentation : public virtual PTRepresentation { virtual bool GetFunctionalGroupNames(policy::FunctionalGroupNames& names) = 0; /** - * @brief Set app policy to pre_DataConsented policy - * @param app_id Policy ID of application to be changed - * @return true, if succeeded, otherwise - false - */ + * @brief Set app policy to pre_DataConsented policy + * @param app_id Policy ID of application to be changed + * @return true, if succeeded, otherwise - false + */ virtual bool SetPredataPolicy(const std::string& app_id) = 0; /** diff --git a/src/components/policy/policy_external/include/policy/pt_representation.h b/src/components/policy/policy_external/include/policy/pt_representation.h index f25fcc6cab..6eaa718cf0 100644 --- a/src/components/policy/policy_external/include/policy/pt_representation.h +++ b/src/components/policy/policy_external/include/policy/pt_representation.h @@ -33,11 +33,11 @@ #ifndef SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_PT_REPRESENTATION_H_ #define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_PT_REPRESENTATION_H_ -#include <vector> #include <string> -#include "policy/policy_types.h" -#include "policy/policy_table/types.h" +#include <vector> #include "policy/policy_settings.h" +#include "policy/policy_table/types.h" +#include "policy/policy_types.h" namespace policy_table = rpc::policy_table_interface_base; @@ -268,10 +268,10 @@ class PTRepresentation { virtual bool IsDefaultPolicy(const std::string& app_id) const = 0; /** - * Checks if the application has pre_data policy - * @param app_id application id - * @return true if application has pre_data policy - */ + * Checks if the application has pre_data policy + * @param app_id application id + * @return true if application has pre_data policy + */ virtual bool IsPredataPolicy(const std::string& app_id) const = 0; /** diff --git a/src/components/policy/policy_external/include/policy/sql_pt_ext_representation.h b/src/components/policy/policy_external/include/policy/sql_pt_ext_representation.h index bd2097cfe3..889ede9d20 100644 --- a/src/components/policy/policy_external/include/policy/sql_pt_ext_representation.h +++ b/src/components/policy/policy_external/include/policy/sql_pt_ext_representation.h @@ -34,8 +34,8 @@ #define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_SQL_PT_EXT_REPRESENTATION_H_ #include <string> -#include "policy/sql_pt_representation.h" #include "policy/pt_ext_representation.h" +#include "policy/sql_pt_representation.h" namespace policy { diff --git a/src/components/policy/policy_external/include/policy/sql_pt_representation.h b/src/components/policy/policy_external/include/policy/sql_pt_representation.h index 581340ba02..826c9b3b6e 100644 --- a/src/components/policy/policy_external/include/policy/sql_pt_representation.h +++ b/src/components/policy/policy_external/include/policy/sql_pt_representation.h @@ -35,9 +35,9 @@ #include <string> #include <vector> +#include "policy/policy_table/types.h" #include "policy/pt_representation.h" #include "rpc_base/rpc_base.h" -#include "policy/policy_table/types.h" namespace policy_table = rpc::policy_table_interface_base; diff --git a/src/components/policy/policy_external/include/policy/status.h b/src/components/policy/policy_external/include/policy/status.h index 18789ecf99..336d59e869 100644 --- a/src/components/policy/policy_external/include/policy/status.h +++ b/src/components/policy/policy_external/include/policy/status.h @@ -75,41 +75,41 @@ class Status { const policy::PolicyTableStatus enum_status); /** - * @brief Destructor - */ + * @brief Destructor + */ virtual ~Status(); /** - * @brief Process event by setting next status in case event can affect - * current status or ignores the event - * @param manager Status manager pointer - * @param event Event which needs to be processed - */ + * @brief Process event by setting next status in case event can affect + * current status or ignores the event + * @param manager Status manager pointer + * @param event Event which needs to be processed + */ virtual void ProcessEvent(UpdateStatusManager* manager, UpdateEvent event) = 0; /** - * @brief Return current status as string value - * @return Status as string - */ + * @brief Return current status as string value + * @return Status as string + */ const std::string get_status_string() const; /** - * @brief Return status as enum value - * @return Status as enum value - */ + * @brief Return status as enum value + * @return Status as enum value + */ PolicyTableStatus get_status() const; /** - * @brief Check whether update is required in terms of status - * @return True if update is required, otherwise - false - */ + * @brief Check whether update is required in terms of status + * @return True if update is required, otherwise - false + */ virtual bool IsUpdateRequired() const; /** - * @brief Check whether update is pending in terms of status - * @return True if update is pending, otherwise - false - */ + * @brief Check whether update is pending in terms of status + * @return True if update is pending, otherwise - false + */ virtual bool IsUpdatePending() const; private: @@ -128,11 +128,11 @@ class UpToDateStatus : public Status { UpToDateStatus(); /** - * @brief Process event by setting next status in case event can affect - * current status or ignores the event - * @param manager Status manager pointer - * @param event Event which needs to be processed - */ + * @brief Process event by setting next status in case event can affect + * current status or ignores the event + * @param manager Status manager pointer + * @param event Event which needs to be processed + */ void ProcessEvent(UpdateStatusManager* manager, UpdateEvent event) OVERRIDE; }; @@ -147,17 +147,17 @@ class UpdateNeededStatus : public Status { UpdateNeededStatus(); /** - * @brief Process event by setting next status in case event can affect - * current status or ignores the event - * @param manager Status manager pointer - * @param event Event which needs to be processed - */ + * @brief Process event by setting next status in case event can affect + * current status or ignores the event + * @param manager Status manager pointer + * @param event Event which needs to be processed + */ void ProcessEvent(UpdateStatusManager* manager, UpdateEvent event) OVERRIDE; /** - * @brief Check whether update is required in terms of status - * @return True if update is required, otherwise - false - */ + * @brief Check whether update is required in terms of status + * @return True if update is required, otherwise - false + */ bool IsUpdateRequired() const OVERRIDE; }; @@ -172,25 +172,25 @@ class UpdatingStatus : public Status { UpdatingStatus(); /** - * @brief Process event by setting next status in case event can affect - * current status or ignores the event - * @param manager Status manager pointer - * @param event Event which needs to be processed - */ + * @brief Process event by setting next status in case event can affect + * current status or ignores the event + * @param manager Status manager pointer + * @param event Event which needs to be processed + */ void ProcessEvent(UpdateStatusManager* manager, UpdateEvent event) OVERRIDE; /** - * @brief Check whether update is required in terms of status - * @return True if update is required, otherwise - false - */ + * @brief Check whether update is required in terms of status + * @return True if update is required, otherwise - false + */ bool IsUpdateRequired() const OVERRIDE; /** - * @brief Check whether update is pending in terms of status - * @return True if update is pending, otherwise - false - */ + * @brief Check whether update is pending in terms of status + * @return True if update is pending, otherwise - false + */ bool IsUpdatePending() const OVERRIDE; }; -} +} // namespace policy #endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_STATUS_H_ diff --git a/src/components/policy/policy_external/include/policy/update_status_manager.h b/src/components/policy/policy_external/include/policy/update_status_manager.h index 3a9e13b83f..9c0e29407e 100644 --- a/src/components/policy/policy_external/include/policy/update_status_manager.h +++ b/src/components/policy/policy_external/include/policy/update_status_manager.h @@ -34,14 +34,13 @@ #define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_UPDATE_STATUS_MANAGER_H_ #include "policy/policy_types.h" -#include "utils/lock.h" -#include "utils/threads/thread.h" -#include "utils/threads/thread_delegate.h" +#include "policy/status.h" #include "utils/conditional_variable.h" #include "utils/lock.h" #include "utils/logger.h" #include "utils/macro.h" -#include "policy/status.h" +#include "utils/threads/thread.h" +#include "utils/threads/thread_delegate.h" namespace policy { @@ -235,6 +234,6 @@ class UpdateStatusManager { UpdateThreadDelegate* update_status_thread_delegate_; threads::Thread* thread_; }; -} +} // namespace policy #endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_UPDATE_STATUS_MANAGER_H_ diff --git a/src/components/policy/policy_external/include/policy/usage_statistics/counter.h b/src/components/policy/policy_external/include/policy/usage_statistics/counter.h index c145bb432b..047a545150 100644 --- a/src/components/policy/policy_external/include/policy/usage_statistics/counter.h +++ b/src/components/policy/policy_external/include/policy/usage_statistics/counter.h @@ -34,11 +34,11 @@ #define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_USAGE_STATISTICS_COUNTER_H_ #include <ctime> -#include "policy/usage_statistics/statistics_manager.h" #include "policy/usage_statistics/app_stopwatch.h" +#include "policy/usage_statistics/statistics_manager.h" -#include "utils/timer.h" #include "utils/macro.h" +#include "utils/timer.h" namespace usage_statistics { diff --git a/src/components/policy/policy_external/src/cache_manager.cc b/src/components/policy/policy_external/src/cache_manager.cc index 4a738aa6ed..1eb103be26 100644 --- a/src/components/policy/policy_external/src/cache_manager.cc +++ b/src/components/policy/policy_external/src/cache_manager.cc @@ -33,27 +33,27 @@ #include "policy/cache_manager.h" #include <algorithm> -#include <functional> -#include <ctime> #include <cmath> -#include <utility> +#include <ctime> +#include <functional> #include <string> +#include <utility> #include <vector> -#include "utils/file_system.h" -#include "utils/helpers.h" -#include "json/reader.h" #include "json/features.h" +#include "json/reader.h" #include "json/writer.h" -#include "utils/logger.h" +#include "policy/policy_helper.h" +#include "policy/policy_table/enums.h" +#include "policy/sql_pt_ext_representation.h" +#include "rpc_base/rpc_base.h" #include "utils/date_time.h" +#include "utils/file_system.h" #include "utils/gen_hash.h" +#include "utils/helpers.h" +#include "utils/logger.h" #include "utils/threads/thread.h" #include "utils/threads/thread_delegate.h" -#include "rpc_base/rpc_base.h" -#include "policy/policy_table/enums.h" -#include "policy/policy_helper.h" -#include "policy/sql_pt_ext_representation.h" namespace policy_table = rpc::policy_table_interface_base; @@ -904,9 +904,9 @@ bool CacheManager::HasDeviceSpecifiedConsent(const std::string& device_id, return false; } const std::string consent = is_allowed ? "allowed" : "disallowed"; - LOG4CXX_INFO(logger_, - "DeviceGetDeviceGroupsFromPolicies is already " << consent - << "."); + LOG4CXX_INFO( + logger_, + "DeviceGetDeviceGroupsFromPolicies is already " << consent << "."); return true; } @@ -2184,9 +2184,9 @@ bool CacheManager::CleanupUnpairedDevices() { LOG4CXX_DEBUG(logger_, "Device_data size is: " << device_data.size()); device_data.erase(it_device); - LOG4CXX_INFO(logger_, - "Device id " << *iter - << " had been deleted from device_data section."); + LOG4CXX_INFO( + logger_, + "Device id " << *iter << " had been deleted from device_data section."); LOG4CXX_DEBUG(logger_, "Device_data size is: " << device_data.size()); } is_unpaired_.clear(); @@ -2763,7 +2763,7 @@ ExternalConsentStatus CacheManager::GetExternalConsentEntities() { policy_table::DisallowedByExternalConsentEntities::const_iterator it_2 = (*it->second.disallowed_by_external_consent_entities_off).begin(); for (; it_2 != - (*it->second.disallowed_by_external_consent_entities_off).end(); + (*it->second.disallowed_by_external_consent_entities_off).end(); ++it_2) { items.insert(ExternalConsentStatusItem( it_2->entity_type, it_2->entity_id, EntityStatus::kStatusOff)); @@ -2912,8 +2912,9 @@ void CacheManager::MergeFG(const policy_table::PolicyTable& new_pt, void CacheManager::MergeAP(const policy_table::PolicyTable& new_pt, policy_table::PolicyTable& pt) { LOG4CXX_AUTO_TRACE(logger_); - pt.app_policies_section.device = const_cast<policy_table::PolicyTable&>( - new_pt).app_policies_section.device; + pt.app_policies_section.device = + const_cast<policy_table::PolicyTable&>(new_pt) + .app_policies_section.device; pt.app_policies_section.apps[kDefaultId] = const_cast<policy_table::PolicyTable&>(new_pt) diff --git a/src/components/policy/policy_external/src/policy_helper.cc b/src/components/policy/policy_external/src/policy_helper.cc index c9df969bd1..e8855bb11a 100644 --- a/src/components/policy/policy_external/src/policy_helper.cc +++ b/src/components/policy/policy_external/src/policy_helper.cc @@ -30,13 +30,13 @@ POSSIBILITY OF SUCH DAMAGE. */ +#include "policy/policy_helper.h" +#include <string.h> #include <algorithm> #include <sstream> -#include <string.h> -#include "utils/logger.h" -#include "utils/custom_string.h" -#include "policy/policy_helper.h" #include "policy/policy_manager_impl.h" +#include "utils/custom_string.h" +#include "utils/logger.h" namespace policy { @@ -360,16 +360,16 @@ bool CheckAppPolicy::operator()(const AppPoliciesValueType& app_policy) { } if (RESULT_NO_CHANGES == result) { - LOG4CXX_INFO(logger_, - "Permissions for application:" << app_id - << " wasn't changed."); + LOG4CXX_INFO( + logger_, + "Permissions for application:" << app_id << " wasn't changed."); AddResult(app_id, result); return true; } - LOG4CXX_INFO(logger_, - "Permissions for application:" << app_id - << " have been changed."); + LOG4CXX_INFO( + logger_, + "Permissions for application:" << app_id << " have been changed."); if (!IsPredefinedApp(app_policy)) { SetPendingPermissions(app_policy, result, permissions_diff); 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 742435098e..15900f0187 100644 --- a/src/components/policy/policy_external/src/policy_manager_impl.cc +++ b/src/components/policy/policy_external/src/policy_manager_impl.cc @@ -32,23 +32,23 @@ #include "policy/policy_manager_impl.h" #include <algorithm> -#include <set> -#include <queue> +#include <functional> #include <iterator> #include <limits> +#include <queue> +#include <set> #include <vector> -#include <functional> +#include "config_profile/profile.h" #include "json/reader.h" #include "json/writer.h" +#include "policy/cache_manager.h" +#include "policy/policy_helper.h" #include "policy/policy_table.h" #include "policy/pt_representation.h" -#include "policy/policy_helper.h" +#include "policy/update_status_manager.h" +#include "utils/date_time.h" #include "utils/file_system.h" #include "utils/logger.h" -#include "utils/date_time.h" -#include "policy/cache_manager.h" -#include "policy/update_status_manager.h" -#include "config_profile/profile.h" #include "policy/access_remote.h" #include "policy/access_remote_impl.h" @@ -954,8 +954,9 @@ void PolicyManagerImpl::CheckPermissions(const PTString& app_id, for (; end != parameter; ++parameter) { if (!result.HasParameter(*parameter)) { LOG4CXX_DEBUG(logger_, - "Parameter " << *parameter << " is unknown." - " Adding to undefined list."); + "Parameter " << *parameter + << " is unknown." + " Adding to undefined list."); result.list_of_undefined_params.insert(*parameter); } } @@ -990,7 +991,8 @@ void PolicyManagerImpl::SendNotificationOnPermissionsUpdated( if (device_id.empty()) { LOG4CXX_WARN(logger_, "Couldn't find device info for application id " - "'" << application_id << "'"); + "'" << application_id + << "'"); return; } @@ -2189,9 +2191,9 @@ void PolicyManagerImpl::SendHMILevelChanged(const ApplicationOnDevice& who) { if (GetDefaultHmi(who.app_id, &default_hmi)) { listener()->OnUpdateHMIStatus(who.dev_id, who.app_id, default_hmi); } else { - LOG4CXX_WARN(logger_, - "Couldn't get default HMI level for application " - << who.app_id); + LOG4CXX_WARN( + logger_, + "Couldn't get default HMI level for application " << who.app_id); } } diff --git a/src/components/policy/policy_external/src/policy_table/types.cc b/src/components/policy/policy_external/src/policy_table/types.cc index f95b270fdf..ca3f8a1648 100644 --- a/src/components/policy/policy_external/src/policy_table/types.cc +++ b/src/components/policy/policy_external/src/policy_table/types.cc @@ -1,5 +1,5 @@ -#include <algorithm> #include "policy/policy_table/types.h" +#include <algorithm> #include "rpc_base/rpc_base_json_inl.h" namespace rpc { diff --git a/src/components/policy/policy_external/src/policy_table/validation.cc b/src/components/policy/policy_external/src/policy_table/validation.cc index fad8509711..f9c3f82793 100644 --- a/src/components/policy/policy_external/src/policy_table/validation.cc +++ b/src/components/policy/policy_external/src/policy_table/validation.cc @@ -1,15 +1,15 @@ -#include <iostream> #include <algorithm> +#include <iostream> #include "policy/policy_table/types.h" -#include "utils/logger.h" #include "utils/helpers.h" +#include "utils/logger.h" namespace { bool IsPredefinedApplication(const std::string& app_id) { using namespace rpc::policy_table_interface_base; return kPreDataConsentApp == app_id || kDefaultApp == app_id; } -} +} // namespace namespace rpc { namespace policy_table_interface_base { @@ -102,9 +102,9 @@ bool ApplicationPoliciesSection::Validate() const { } if (!app_request_types.is_valid()) { - LOG4CXX_WARN(logger_, - "Invalid RequestTypes for " << app_id - << " Will be cleaned up."); + LOG4CXX_WARN( + logger_, + "Invalid RequestTypes for " << app_id << " Will be cleaned up."); app_request_types.CleanUp(); if (app_request_types.is_cleaned_up()) { if (PT_PRELOADED == pt_type) { diff --git a/src/components/policy/policy_external/src/sql_pt_ext_representation.cc b/src/components/policy/policy_external/src/sql_pt_ext_representation.cc index b19feddee6..e4711a3cd2 100644 --- a/src/components/policy/policy_external/src/sql_pt_ext_representation.cc +++ b/src/components/policy/policy_external/src/sql_pt_ext_representation.cc @@ -29,15 +29,15 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "policy/sql_pt_ext_representation.h" #include <algorithm> #include <utility> -#include "utils/logger.h" -#include "policy/sql_pt_ext_representation.h" -#include "policy/sql_wrapper.h" -#include "policy/sql_pt_queries.h" -#include "policy/sql_pt_ext_queries.h" -#include "policy/policy_helper.h" #include "policy/cache_manager.h" +#include "policy/policy_helper.h" +#include "policy/sql_pt_ext_queries.h" +#include "policy/sql_pt_queries.h" +#include "policy/sql_wrapper.h" +#include "utils/logger.h" namespace policy { diff --git a/src/components/policy/policy_external/src/sql_pt_representation.cc b/src/components/policy/policy_external/src/sql_pt_representation.cc index dce86f6d52..1bb0cf0fa1 100644 --- a/src/components/policy/policy_external/src/sql_pt_representation.cc +++ b/src/components/policy/policy_external/src/sql_pt_representation.cc @@ -30,24 +30,24 @@ POSSIBILITY OF SUCH DAMAGE. */ -#include <sstream> -#include <stdlib.h> -#include <stdint.h> #include <errno.h> +#include <stdint.h> +#include <stdlib.h> #include <unistd.h> +#include <sstream> -#include "utils/logger.h" +#include "config_profile/profile.h" +#include "policy/cache_manager.h" +#include "policy/policy_helper.h" +#include "policy/sql_pt_ext_queries.h" +#include "policy/sql_pt_queries.h" +#include "policy/sql_pt_representation.h" +#include "policy/sql_wrapper.h" #include "utils/date_time.h" -#include "utils/sqlite_wrapper/sql_database.h" #include "utils/file_system.h" #include "utils/gen_hash.h" -#include "policy/sql_pt_representation.h" -#include "policy/sql_wrapper.h" -#include "policy/sql_pt_ext_queries.h" -#include "policy/sql_pt_queries.h" -#include "policy/policy_helper.h" -#include "policy/cache_manager.h" -#include "config_profile/profile.h" +#include "utils/logger.h" +#include "utils/sqlite_wrapper/sql_database.h" namespace policy { @@ -130,9 +130,9 @@ void SQLPTRepresentation::CheckPermissions(const PTString& app_id, utils::dbms::SQLQuery query(db()); if (!query.Prepare(sql_pt::kSelectRpc)) { - LOG4CXX_WARN(logger_, - "Incorrect select statement from rpcs" - << query.LastError().text()); + LOG4CXX_WARN( + logger_, + "Incorrect select statement from rpcs" << query.LastError().text()); return; } query.Bind(0, app_id); @@ -408,9 +408,9 @@ InitResult SQLPTRepresentation::Init(const PolicySettings* settings) { utils::dbms::SQLQuery check_first_run(db()); if (check_first_run.Prepare(sql_pt::kIsFirstRun) && check_first_run.Next()) { - LOG4CXX_INFO(logger_, - "Selecting is first run " - << check_first_run.GetBoolean(0)); + LOG4CXX_INFO( + logger_, + "Selecting is first run " << check_first_run.GetBoolean(0)); if (check_first_run.GetBoolean(0)) { utils::dbms::SQLQuery set_not_first_run(db()); set_not_first_run.Exec(sql_pt::kSetNotFirstRun); @@ -1183,9 +1183,9 @@ bool SQLPTRepresentation::SaveAppGroup( query.Bind(0, app_id); query.Bind(1, *it); if (!query.Exec() || !query.Reset()) { - LOG4CXX_WARN(logger_, - "Incorrect insert into app group." - << query.LastError().text()); + LOG4CXX_WARN( + logger_, + "Incorrect insert into app group." << query.LastError().text()); return false; } } diff --git a/src/components/policy/policy_external/src/usage_statistics/counter.cc b/src/components/policy/policy_external/src/usage_statistics/counter.cc index d46f6a315a..5165c46edb 100644 --- a/src/components/policy/policy_external/src/usage_statistics/counter.cc +++ b/src/components/policy/policy_external/src/usage_statistics/counter.cc @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_POLICY_INCLUDE_POLICY_STATISTICS_MANAGER_H_ #define SRC_COMPONENTS_POLICY_INCLUDE_POLICY_STATISTICS_MANAGER_H_ -#include <cassert> #include "policy/usage_statistics/counter.h" +#include <cassert> #include "utils/date_time.h" #include "utils/timer_task_impl.h" diff --git a/src/components/policy/policy_external/test/counter_test.cc b/src/components/policy/policy_external/test/counter_test.cc index 22b19c878e..af166f96ad 100644 --- a/src/components/policy/policy_external/test/counter_test.cc +++ b/src/components/policy/policy_external/test/counter_test.cc @@ -29,12 +29,12 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#include "policy/usage_statistics/counter.h" #include "gtest/gtest.h" #include "policy/usage_statistics/mock_statistics_manager.h" -#include "policy/usage_statistics/counter.h" -using ::testing::StrictMock; using ::testing::InSequence; +using ::testing::StrictMock; namespace test { namespace components { @@ -179,6 +179,6 @@ TEST( // Act hmi_full_stopwatch.WriteTime(); } -} // namespace usage_statistics -} // components +} // namespace usage_statistics_test +} // namespace components } // namespace test diff --git a/src/components/policy/policy_external/test/include/policy/mock_pt_ext_representation.h b/src/components/policy/policy_external/test/include/policy/mock_pt_ext_representation.h index 3225e79e01..b307270b10 100644 --- a/src/components/policy/policy_external/test/include/policy/mock_pt_ext_representation.h +++ b/src/components/policy/policy_external/test/include/policy/mock_pt_ext_representation.h @@ -37,10 +37,10 @@ #include "gmock/gmock.h" +#include "mock_pt_representation.h" +#include "policy/policy_table/types.h" #include "policy/pt_ext_representation.h" #include "rpc_base/rpc_base.h" -#include "policy/policy_table/types.h" -#include "mock_pt_representation.h" namespace policy_table = ::rpc::policy_table_interface_base; diff --git a/src/components/policy/policy_external/test/include/policy/mock_pt_representation.h b/src/components/policy/policy_external/test/include/policy/mock_pt_representation.h index 3870e4ece1..33d4c46e64 100644 --- a/src/components/policy/policy_external/test/include/policy/mock_pt_representation.h +++ b/src/components/policy/policy_external/test/include/policy/mock_pt_representation.h @@ -37,9 +37,9 @@ #include "gmock/gmock.h" +#include "policy/policy_table/types.h" #include "policy/pt_representation.h" #include "rpc_base/rpc_base.h" -#include "policy/policy_table/types.h" namespace policy_table = ::rpc::policy_table_interface_base; diff --git a/src/components/policy/policy_external/test/include/policy/policy_manager_impl_test_base.h b/src/components/policy/policy_external/test/include/policy/policy_manager_impl_test_base.h index 23701e86de..65972e0a82 100644 --- a/src/components/policy/policy_external/test/include/policy/policy_manager_impl_test_base.h +++ b/src/components/policy/policy_external/test/include/policy/policy_manager_impl_test_base.h @@ -40,16 +40,16 @@ #include "policy/policy_manager_impl.h" #include "policy/mock_cache_manager.h" -#include "policy/mock_update_status_manager.h" #include "policy/mock_policy_listener.h" #include "policy/mock_policy_settings.h" +#include "policy/mock_update_status_manager.h" namespace test { namespace components { namespace policy_test { -using ::testing::NiceMock; using ::policy::PolicyManagerImpl; +using ::testing::NiceMock; typedef std::multimap<std::string, policy_table::Rpcs&> UserConsentPromptToRpcsConnections; diff --git a/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc b/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc index 93d4e19751..066b5756e2 100644 --- a/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc +++ b/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc @@ -30,19 +30,19 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#include <stdint.h> #include <fstream> #include <string> #include <vector> -#include <stdint.h> #include "gtest/gtest.h" #include "policy/policy_manager_impl_test_base.h" #include "policy/policy_table/types.h" +#include "json/reader.h" #include "utils/date_time.h" #include "utils/gen_hash.h" -#include "json/reader.h" namespace test { namespace components { @@ -1713,6 +1713,6 @@ TEST_F( CompareRequestTypesContainers(correct_types, received_types); } -} // namespace policy +} // namespace policy_test } // namespace components } // namespace test diff --git a/src/components/policy/policy_external/test/policy_manager_impl_snapshot_test.cc b/src/components/policy/policy_external/test/policy_manager_impl_snapshot_test.cc index c1ff31f748..3c6377cf5f 100644 --- a/src/components/policy/policy_external/test/policy_manager_impl_snapshot_test.cc +++ b/src/components/policy/policy_external/test/policy_manager_impl_snapshot_test.cc @@ -63,9 +63,8 @@ TEST_F(PolicyManagerImplTest2, UpdatedPreloadedPT_ExpectLPT_IsUpdated) { Json::Value val2(Json::arrayValue); val2[0] = hmi_level_[index_]; val[new_data.new_field_value_]["hmi_levels"] = val2; - root["policy_table"]["functional_groupings"][new_data - .new_field_name_]["rpcs"] = - val; + root["policy_table"]["functional_groupings"][new_data.new_field_name_] + ["rpcs"] = val; root["policy_table"]["functional_groupings"][new_data.new_field_name_] ["user_consent_prompt"] = new_data.new_field_name_; } @@ -333,6 +332,6 @@ TEST_F(PolicyManagerImplTest2, AddDevice_RegisterDevice_TRUE) { EXPECT_TRUE(result); } -} // namespace policy +} // namespace policy_test } // namespace components } // namespace test diff --git a/src/components/policy/policy_external/test/policy_manager_impl_stress_test.cc b/src/components/policy/policy_external/test/policy_manager_impl_stress_test.cc index 2f1cc5a9d3..f886108463 100644 --- a/src/components/policy/policy_external/test/policy_manager_impl_stress_test.cc +++ b/src/components/policy/policy_external/test/policy_manager_impl_stress_test.cc @@ -29,15 +29,15 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "gtest/gtest.h" #include <fstream> +#include "gtest/gtest.h" #include "mock_policy_listener.h" #include "policy/policy_manager_impl.h" -using ::testing::_; -using ::policy::PolicyManagerImpl; using ::policy::BinaryMessage; using ::policy::MockPolicyListener; +using ::policy::PolicyManagerImpl; +using ::testing::_; namespace test { namespace components { diff --git a/src/components/policy/policy_external/test/policy_manager_impl_test.cc b/src/components/policy/policy_external/test/policy_manager_impl_test.cc index 1916e09efc..47b3959aee 100644 --- a/src/components/policy/policy_external/test/policy_manager_impl_test.cc +++ b/src/components/policy/policy_external/test/policy_manager_impl_test.cc @@ -32,16 +32,16 @@ #include <fstream> -#include "json/reader.h" -#include "gtest/gtest.h" #include <utility> +#include "gtest/gtest.h" +#include "json/reader.h" #include "policy/policy_manager_impl_test_base.h" using ::testing::_; +using ::testing::AtLeast; using ::testing::Return; using ::testing::SetArgReferee; -using ::testing::AtLeast; namespace test { namespace components { @@ -1151,6 +1151,6 @@ TEST_F( EXPECT_EQ(Boolean(false), updated_group_2->second); } -} // namespace policy +} // namespace policy_test } // namespace components } // namespace test diff --git a/src/components/policy/policy_external/test/policy_manager_impl_test_base.cc b/src/components/policy/policy_external/test/policy_manager_impl_test_base.cc index 13efa39805..82d87cd7ba 100644 --- a/src/components/policy/policy_external/test/policy_manager_impl_test_base.cc +++ b/src/components/policy/policy_external/test/policy_manager_impl_test_base.cc @@ -30,17 +30,17 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include <string> -#include <fstream> #include <stdint.h> +#include <fstream> +#include <string> #include <vector> #include "policy/policy_manager_impl_test_base.h" #include "utils/file_system.h" -#include "utils/gen_hash.h" #include "json/reader.h" +#include "utils/gen_hash.h" #include "policy/mock_pt_ext_representation.h" @@ -48,10 +48,10 @@ namespace test { namespace components { namespace policy_test { +using ::testing::_; +using ::testing::ContainerEq; using ::testing::Return; using ::testing::ReturnRef; -using ::testing::ContainerEq; -using ::testing::_; // Help functions char GenRandomChar(char range_from, char range_to) { diff --git a/src/components/policy/policy_external/test/policy_manager_impl_user_consent_test.cc b/src/components/policy/policy_external/test/policy_manager_impl_user_consent_test.cc index 93cfa36277..c58ae00ff4 100644 --- a/src/components/policy/policy_external/test/policy_manager_impl_user_consent_test.cc +++ b/src/components/policy/policy_external/test/policy_manager_impl_user_consent_test.cc @@ -670,6 +670,6 @@ TEST_F( policy_manager_->SendNotificationOnPermissionsUpdated(app_id_2_); } -} // namespace policy +} // namespace policy_test } // namespace components } // namespace test diff --git a/src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc b/src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc index b87598b986..a9c7667ba6 100644 --- a/src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc +++ b/src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc @@ -29,27 +29,27 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include <vector> -#include <map> +#include "policy/sql_pt_ext_representation.h" #include <algorithm> -#include <utility> -#include <string> -#include <iterator> #include <iostream> +#include <iterator> +#include <map> +#include <string> +#include <utility> +#include <vector> #include "gtest/gtest.h" -#include "policy/sql_pt_ext_representation.h" -#include "utils/gen_hash.h" -#include "utils/file_system.h" -#include "sqlite_wrapper/sql_query.h" -#include "rpc_base/rpc_base.h" -#include "policy/policy_table/types.h" #include "policy/mock_policy_settings.h" +#include "policy/policy_table/types.h" +#include "rpc_base/rpc_base.h" +#include "sqlite_wrapper/sql_query.h" +#include "utils/file_system.h" +#include "utils/gen_hash.h" using namespace ::policy; namespace policy_table = rpc::policy_table_interface_base; -using std::string; using std::map; using std::pair; +using std::string; using std::vector; using testing::ReturnRef; diff --git a/src/components/policy/policy_external/test/sql_pt_representation_test.cc b/src/components/policy/policy_external/test/sql_pt_representation_test.cc index c43c9dace6..9e6e18b77d 100644 --- a/src/components/policy/policy_external/test/sql_pt_representation_test.cc +++ b/src/components/policy/policy_external/test/sql_pt_representation_test.cc @@ -29,38 +29,38 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include <vector> -#include <string> -#include <algorithm> -#include <fstream> #include <stdio.h> #include <sys/stat.h> +#include <algorithm> +#include <fstream> #include <memory> +#include <string> +#include <vector> #include "gtest/gtest.h" -#include "policy/sql_pt_representation.h" -#include "utils/file_system.h" -#include "utils/system.h" -#include "policy/sql_wrapper.h" -#include "policy/policy_types.h" -#include "json/writer.h" #include "json/reader.h" -#include "policy/policy_table/types.h" +#include "json/writer.h" +#include "policy/mock_policy_settings.h" #include "policy/policy_table/enums.h" +#include "policy/policy_table/types.h" +#include "policy/policy_types.h" +#include "policy/sql_pt_representation.h" +#include "policy/sql_wrapper.h" #include "rpc_base/rpc_base.h" -#include "policy/mock_policy_settings.h" +#include "utils/file_system.h" +#include "utils/system.h" namespace policy_table = rpc::policy_table_interface_base; -using policy::SQLPTRepresentation; using policy::CheckPermissionResult; -using policy::UserFriendlyMessage; using policy::EndpointUrls; +using policy::SQLPTRepresentation; +using policy::UserFriendlyMessage; using policy::VehicleInfo; -using testing::ReturnRef; -using testing::Return; -using testing::NiceMock; using testing::Mock; +using testing::NiceMock; +using testing::Return; +using testing::ReturnRef; namespace test { namespace components { diff --git a/src/components/policy/policy_external/test/update_status_manager_test.cc b/src/components/policy/policy_external/test/update_status_manager_test.cc index bf443bb201..f5192471cc 100644 --- a/src/components/policy/policy_external/test/update_status_manager_test.cc +++ b/src/components/policy/policy_external/test/update_status_manager_test.cc @@ -30,10 +30,10 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#include "policy/update_status_manager.h" #include "gtest/gtest.h" #include "policy/mock_policy_listener.h" #include "policy/policy_manager_impl.h" -#include "policy/update_status_manager.h" #include "utils/conditional_variable.h" @@ -43,8 +43,8 @@ namespace policy_test { using namespace ::policy; using ::testing::_; -using ::testing::Return; using testing::NiceMock; +using ::testing::Return; class UpdateStatusManagerTest : public ::testing::Test { protected: @@ -105,7 +105,7 @@ class WaitAsync { const uint32_t timeout_; sync_primitives::ConditionalVariable cond_var_; }; -} +} // namespace ACTION_P(NotifyAsync, waiter) { waiter->Notify(); @@ -298,6 +298,6 @@ TEST_F(UpdateStatusManagerTest, EXPECT_FALSE(manager_->IsAppsSearchInProgress()); } -} // namespace policy +} // namespace policy_test } // namespace components } // namespace test diff --git a/src/components/policy/policy_regular/include/policy/access_remote.h b/src/components/policy/policy_regular/include/policy/access_remote.h index c4de9b7e1f..c0df6b729f 100644 --- a/src/components/policy/policy_regular/include/policy/access_remote.h +++ b/src/components/policy/policy_regular/include/policy/access_remote.h @@ -32,9 +32,9 @@ #ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_ACCESS_REMOTE_H_ #define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_ACCESS_REMOTE_H_ -#include <vector> #include <ostream> #include <string> +#include <vector> #include "policy/policy_table/types.h" #include "policy/policy_types.h" diff --git a/src/components/policy/policy_regular/include/policy/cache_manager.h b/src/components/policy/policy_regular/include/policy/cache_manager.h index 840b706c8b..30732f685c 100644 --- a/src/components/policy/policy_regular/include/policy/cache_manager.h +++ b/src/components/policy/policy_regular/include/policy/cache_manager.h @@ -35,15 +35,15 @@ #include <map> +#include "policy/cache_manager_interface.h" #include "policy/pt_representation.h" #include "policy/usage_statistics/statistics_manager.h" -#include "policy/cache_manager_interface.h" #include "utils/threads/thread.h" #include "utils/threads/thread_delegate.h" -#include "utils/lock.h" -#include "utils/conditional_variable.h" #include "policy/policy_types.h" +#include "utils/conditional_variable.h" +#include "utils/lock.h" namespace policy { class PolicySettings; @@ -244,7 +244,7 @@ class CacheManager : public CacheManagerInterface { * @brief Check if an app can send unknown rpc requests to an app service * provider * @param policy_app_id Unique application id - */ + */ virtual bool UnknownRPCPassthroughAllowed( const std::string& policy_app_id) const; diff --git a/src/components/policy/policy_regular/include/policy/cache_manager_interface.h b/src/components/policy/policy_regular/include/policy/cache_manager_interface.h index 2c14fd8cba..da15a4ecab 100644 --- a/src/components/policy/policy_regular/include/policy/cache_manager_interface.h +++ b/src/components/policy/policy_regular/include/policy/cache_manager_interface.h @@ -36,10 +36,10 @@ #include <string> #include <vector> -#include "policy/usage_statistics/counter.h" -#include "policy/policy_types.h" #include "policy/policy_settings.h" #include "policy/policy_table/types.h" +#include "policy/policy_types.h" +#include "policy/usage_statistics/counter.h" namespace policy_table = rpc::policy_table_interface_base; @@ -250,7 +250,7 @@ class CacheManagerInterface { * @brief Check if an app can send unknown rpc requests to an app service * provider * @param policy_app_id Unique application id - */ + */ virtual bool UnknownRPCPassthroughAllowed( const std::string& policy_app_id) const = 0; @@ -460,10 +460,10 @@ class CacheManagerInterface { std::string& default_hmi) const = 0; /** - * Gets HMI types from specific policy - * @param app_id ID application - * @return list of HMI types - */ + * Gets HMI types from specific policy + * @param app_id ID application + * @return list of HMI types + */ virtual const policy_table::AppHMITypes* GetHMITypes( const std::string& app_id) = 0; diff --git a/src/components/policy/policy_regular/include/policy/policy_helper.h b/src/components/policy/policy_regular/include/policy/policy_helper.h index 3ca0f93ebd..4c697858f5 100644 --- a/src/components/policy/policy_regular/include/policy/policy_helper.h +++ b/src/components/policy/policy_regular/include/policy/policy_helper.h @@ -246,6 +246,6 @@ FunctionalGroupIDs FindSame(const FunctionalGroupIDs& first, * @return true, if succeded, otherwise - false */ bool UnwrapAppPolicies(policy_table::ApplicationPolicies& app_policies); -} +} // namespace policy #endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_POLICY_HELPER_H_ diff --git a/src/components/policy/policy_regular/include/policy/policy_manager_impl.h b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h index 911ce65a11..1860f7e591 100644 --- a/src/components/policy/policy_regular/include/policy/policy_manager_impl.h +++ b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h @@ -33,21 +33,21 @@ #ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_POLICY_MANAGER_IMPL_H_ #define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_POLICY_MANAGER_IMPL_H_ -#include <string> -#include <list> #include <cstdint> +#include <list> +#include <string> -#include "utils/lock.h" +#include "policy/access_remote.h" +#include "policy/access_remote_impl.h" +#include "policy/cache_manager_interface.h" +#include "policy/policy_helper.h" #include "policy/policy_manager.h" #include "policy/policy_table.h" -#include "policy/cache_manager_interface.h" -#include "policy/update_status_manager.h" #include "policy/policy_table/functions.h" +#include "policy/update_status_manager.h" #include "policy/usage_statistics/statistics_manager.h" -#include "policy/policy_helper.h" +#include "utils/lock.h" #include "utils/timer.h" -#include "policy/access_remote.h" -#include "policy/access_remote_impl.h" namespace policy_table = rpc::policy_table_interface_base; @@ -672,7 +672,7 @@ class PolicyManagerImpl : public PolicyManager { * provider * @param policy_app_id Unique application id * @return bool true if allowed - */ + */ bool UnknownRPCPassthroughAllowed( const std::string& policy_app_id) const OVERRIDE; @@ -958,11 +958,11 @@ class PolicyManagerImpl : public PolicyManager { void SendAuthTokenUpdated(const std::string policy_app_id); /** - * @brief Gets all allowed module types - * @param policy_app_id unique identifier of application - * @param modules list of allowed module types - * @return true if application has allowed modules - */ + * @brief Gets all allowed module types + * @param policy_app_id unique identifier of application + * @param modules list of allowed module types + * @return true if application has allowed modules + */ bool GetModuleTypes(const std::string& policy_app_id, std::vector<std::string>* modules) const OVERRIDE; diff --git a/src/components/policy/policy_regular/include/policy/policy_types.h b/src/components/policy/policy_regular/include/policy/policy_types.h index 276a0a5dca..0be5919126 100644 --- a/src/components/policy/policy_regular/include/policy/policy_types.h +++ b/src/components/policy/policy_regular/include/policy/policy_types.h @@ -34,15 +34,15 @@ #define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_TYPES_H_ #include <algorithm> -#include <string> -#include <vector> #include <map> +#include <memory> #include <set> +#include <string> #include <utility> -#include <memory> +#include <vector> -#include "utils/helpers.h" #include "transport_manager/common.h" +#include "utils/helpers.h" namespace policy { @@ -119,10 +119,10 @@ typedef std::vector<std::string> StringArray; enum PermitResult { kRpcAllowed = 0, kRpcDisallowed, kRpcUserDisallowed }; /** - * @struct Stores result of check: - * if HMI Level was allowed for RPC to work in - * and list of parameters allowed for RPC if specified in PT. - */ + * @struct Stores result of check: + * if HMI Level was allowed for RPC to work in + * and list of parameters allowed for RPC if specified in PT. + */ struct CheckPermissionResult { CheckPermissionResult() : hmi_level_permitted(kRpcDisallowed) {} diff --git a/src/components/policy/policy_regular/include/policy/pt_representation.h b/src/components/policy/policy_regular/include/policy/pt_representation.h index 378a294532..0534b27093 100644 --- a/src/components/policy/policy_regular/include/policy/pt_representation.h +++ b/src/components/policy/policy_regular/include/policy/pt_representation.h @@ -33,12 +33,12 @@ #ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_PT_REPRESENTATION_H_ #define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_PT_REPRESENTATION_H_ -#include <vector> -#include <string> #include <memory> -#include "policy/policy_types.h" -#include "policy/policy_table/types.h" +#include <string> +#include <vector> #include "policy/policy_settings.h" +#include "policy/policy_table/types.h" +#include "policy/policy_types.h" #include "utils/macro.h" namespace policy { @@ -265,10 +265,10 @@ class PTRepresentation { virtual bool IsDefaultPolicy(const std::string& app_id) const = 0; /** - * Checks if the application has pre_data policy - * @param app_id application id - * @return true if application has pre_data policy - */ + * Checks if the application has pre_data policy + * @param app_id application id + * @return true if application has pre_data policy + */ virtual bool IsPredataPolicy(const std::string& app_id) const = 0; /** diff --git a/src/components/policy/policy_regular/include/policy/sql_pt_representation.h b/src/components/policy/policy_regular/include/policy/sql_pt_representation.h index dfa318454b..e95620fbc2 100644 --- a/src/components/policy/policy_regular/include/policy/sql_pt_representation.h +++ b/src/components/policy/policy_regular/include/policy/sql_pt_representation.h @@ -35,9 +35,9 @@ #include <string> #include <vector> +#include "policy/policy_table/types.h" #include "policy/pt_representation.h" #include "rpc_base/rpc_base.h" -#include "policy/policy_table/types.h" namespace policy_table = rpc::policy_table_interface_base; diff --git a/src/components/policy/policy_regular/include/policy/status.h b/src/components/policy/policy_regular/include/policy/status.h index c1ea2de4c1..8fd3ff559e 100644 --- a/src/components/policy/policy_regular/include/policy/status.h +++ b/src/components/policy/policy_regular/include/policy/status.h @@ -75,41 +75,41 @@ class Status { const policy::PolicyTableStatus enum_status); /** - * @brief Destructor - */ + * @brief Destructor + */ virtual ~Status(); /** - * @brief Process event by setting next status in case event can affect - * current status or ignores the event - * @param manager Status manager pointer - * @param event Event which needs to be processed - */ + * @brief Process event by setting next status in case event can affect + * current status or ignores the event + * @param manager Status manager pointer + * @param event Event which needs to be processed + */ virtual void ProcessEvent(UpdateStatusManagerInterface* manager, UpdateEvent event) = 0; /** - * @brief Return current status as string value - * @return Status as string - */ + * @brief Return current status as string value + * @return Status as string + */ virtual const std::string get_status_string() const; /** - * @brief Return status as enum value - * @return Status as enum value - */ + * @brief Return status as enum value + * @return Status as enum value + */ virtual PolicyTableStatus get_status() const; /** - * @brief Check whether update is required in terms of status - * @return True if update is required, otherwise - false - */ + * @brief Check whether update is required in terms of status + * @return True if update is required, otherwise - false + */ virtual bool IsUpdateRequired() const; /** - * @brief Check whether update is pending in terms of status - * @return True if update is pending, otherwise - false - */ + * @brief Check whether update is pending in terms of status + * @return True if update is pending, otherwise - false + */ virtual bool IsUpdatePending() const; private: @@ -128,11 +128,11 @@ class UpToDateStatus : public Status { UpToDateStatus(); /** - * @brief Process event by setting next status in case event can affect - * current status or ignores the event - * @param manager Status manager pointer - * @param event Event which needs to be processed - */ + * @brief Process event by setting next status in case event can affect + * current status or ignores the event + * @param manager Status manager pointer + * @param event Event which needs to be processed + */ void ProcessEvent(UpdateStatusManagerInterface* manager, UpdateEvent event) OVERRIDE; }; @@ -148,18 +148,18 @@ class UpdateNeededStatus : public Status { UpdateNeededStatus(); /** - * @brief Process event by setting next status in case event can affect - * current status or ignores the event - * @param manager Status manager pointer - * @param event Event which needs to be processed - */ + * @brief Process event by setting next status in case event can affect + * current status or ignores the event + * @param manager Status manager pointer + * @param event Event which needs to be processed + */ void ProcessEvent(UpdateStatusManagerInterface* manager, UpdateEvent event) OVERRIDE; /** - * @brief Check whether update is required in terms of status - * @return True if update is required, otherwise - false - */ + * @brief Check whether update is required in terms of status + * @return True if update is required, otherwise - false + */ bool IsUpdateRequired() const OVERRIDE; }; @@ -174,26 +174,26 @@ class UpdatingStatus : public Status { UpdatingStatus(); /** - * @brief Process event by setting next status in case event can affect - * current status or ignores the event - * @param manager Status manager pointer - * @param event Event which needs to be processed - */ + * @brief Process event by setting next status in case event can affect + * current status or ignores the event + * @param manager Status manager pointer + * @param event Event which needs to be processed + */ void ProcessEvent(UpdateStatusManagerInterface* manager, UpdateEvent event) OVERRIDE; /** - * @brief Check whether update is required in terms of status - * @return True if update is required, otherwise - false - */ + * @brief Check whether update is required in terms of status + * @return True if update is required, otherwise - false + */ bool IsUpdateRequired() const OVERRIDE; /** - * @brief Check whether update is pending in terms of status - * @return True if update is pending, otherwise - false - */ + * @brief Check whether update is pending in terms of status + * @return True if update is pending, otherwise - false + */ bool IsUpdatePending() const OVERRIDE; }; -} +} // namespace policy #endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_STATUS_H_ diff --git a/src/components/policy/policy_regular/include/policy/update_status_manager.h b/src/components/policy/policy_regular/include/policy/update_status_manager.h index c90acd4957..0c79bf0ba4 100644 --- a/src/components/policy/policy_regular/include/policy/update_status_manager.h +++ b/src/components/policy/policy_regular/include/policy/update_status_manager.h @@ -33,15 +33,14 @@ #ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_UPDATE_STATUS_MANAGER_H_ #define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_UPDATE_STATUS_MANAGER_H_ -#include "policy/update_status_manager_interface.h" #include "policy/policy_types.h" -#include "utils/lock.h" -#include "utils/threads/thread.h" -#include "utils/threads/thread_delegate.h" +#include "policy/update_status_manager_interface.h" #include "utils/conditional_variable.h" #include "utils/lock.h" #include "utils/logger.h" #include "utils/macro.h" +#include "utils/threads/thread.h" +#include "utils/threads/thread_delegate.h" namespace policy { @@ -216,6 +215,6 @@ class UpdateStatusManager : public UpdateStatusManagerInterface { bool app_registered_from_non_consented_device_; sync_primitives::Lock apps_search_in_progress_lock_; }; -} +} // namespace policy #endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_UPDATE_STATUS_MANAGER_H_ diff --git a/src/components/policy/policy_regular/include/policy/usage_statistics/counter.h b/src/components/policy/policy_regular/include/policy/usage_statistics/counter.h index 72ae5fd9e0..bd88815012 100644 --- a/src/components/policy/policy_regular/include/policy/usage_statistics/counter.h +++ b/src/components/policy/policy_regular/include/policy/usage_statistics/counter.h @@ -34,11 +34,11 @@ #define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_USAGE_STATISTICS_COUNTER_H_ #include <ctime> -#include "policy/usage_statistics/statistics_manager.h" #include "policy/usage_statistics/app_stopwatch.h" +#include "policy/usage_statistics/statistics_manager.h" -#include "utils/timer.h" #include "utils/macro.h" +#include "utils/timer.h" namespace usage_statistics { diff --git a/src/components/policy/policy_regular/src/cache_manager.cc b/src/components/policy/policy_regular/src/cache_manager.cc index 991c6a1363..ef4937e336 100644 --- a/src/components/policy/policy_regular/src/cache_manager.cc +++ b/src/components/policy/policy_regular/src/cache_manager.cc @@ -33,19 +33,19 @@ #include "policy/cache_manager.h" #include <algorithm> -#include <functional> -#include <ctime> #include <cmath> +#include <ctime> +#include <functional> #include <sstream> -#include "utils/file_system.h" -#include "utils/helpers.h" -#include "json/reader.h" #include "json/features.h" +#include "json/reader.h" #include "json/writer.h" -#include "utils/logger.h" #include "utils/date_time.h" +#include "utils/file_system.h" #include "utils/gen_hash.h" +#include "utils/helpers.h" +#include "utils/logger.h" #include "utils/macro.h" #include "utils/threads/thread.h" #include "utils/threads/thread_delegate.h" @@ -1901,8 +1901,9 @@ void CacheManager::MergeFG(const policy_table::PolicyTable& new_pt, void CacheManager::MergeAP(const policy_table::PolicyTable& new_pt, policy_table::PolicyTable& pt) { LOG4CXX_AUTO_TRACE(logger_); - pt.app_policies_section.device = const_cast<policy_table::PolicyTable&>( - new_pt).app_policies_section.device; + pt.app_policies_section.device = + const_cast<policy_table::PolicyTable&>(new_pt) + .app_policies_section.device; pt.app_policies_section.apps[kDefaultId] = const_cast<policy_table::PolicyTable&>(new_pt) diff --git a/src/components/policy/policy_regular/src/policy_helper.cc b/src/components/policy/policy_regular/src/policy_helper.cc index bae9fceb49..5fa0b314b3 100644 --- a/src/components/policy/policy_regular/src/policy_helper.cc +++ b/src/components/policy/policy_regular/src/policy_helper.cc @@ -30,13 +30,13 @@ POSSIBILITY OF SUCH DAMAGE. */ +#include "policy/policy_helper.h" +#include <string.h> #include <algorithm> #include <sstream> -#include <string.h> -#include "utils/logger.h" -#include "utils/custom_string.h" -#include "policy/policy_helper.h" #include "policy/policy_manager_impl.h" +#include "utils/custom_string.h" +#include "utils/logger.h" namespace policy { @@ -355,15 +355,15 @@ bool CheckAppPolicy::operator()(const AppPoliciesValueType& app_policy) { } } if (RESULT_NO_CHANGES == result) { - LOG4CXX_INFO(logger_, - "Permissions for application:" << app_id - << " wasn't changed."); + LOG4CXX_INFO( + logger_, + "Permissions for application:" << app_id << " wasn't changed."); return true; } - LOG4CXX_INFO(logger_, - "Permissions for application:" << app_id - << " have been changed."); + LOG4CXX_INFO( + logger_, + "Permissions for application:" << app_id << " have been changed."); if (IsPredefinedApp(app_policy)) { for (const policy_table::ApplicationPolicies::value_type& app : @@ -853,4 +853,4 @@ bool UnwrapAppPolicies(policy_table::ApplicationPolicies& app_policies) { return true; } -} +} // namespace policy diff --git a/src/components/policy/policy_regular/src/policy_manager_impl.cc b/src/components/policy/policy_regular/src/policy_manager_impl.cc index 10e1c73e9a..0884fc53b6 100644 --- a/src/components/policy/policy_regular/src/policy_manager_impl.cc +++ b/src/components/policy/policy_regular/src/policy_manager_impl.cc @@ -32,22 +32,22 @@ #include "policy/policy_manager_impl.h" #include <algorithm> -#include <set> -#include <queue> #include <iterator> #include <limits> +#include <queue> +#include <set> #include "json/reader.h" #include "json/writer.h" +#include "policy/policy_helper.h" #include "policy/policy_table.h" #include "policy/pt_representation.h" -#include "policy/policy_helper.h" +#include "utils/date_time.h" #include "utils/file_system.h" #include "utils/logger.h" -#include "utils/date_time.h" +#include "config_profile/profile.h" #include "policy/cache_manager.h" #include "policy/update_status_manager.h" -#include "config_profile/profile.h" #include "utils/timer_task_impl.h" #include "policy/access_remote.h" @@ -675,7 +675,8 @@ void PolicyManagerImpl::SendNotificationOnPermissionsUpdated( if (device_id.empty()) { LOG4CXX_WARN(logger_, "Couldn't find device info for application id " - "'" << application_id << "'"); + "'" << application_id + << "'"); return; } @@ -1457,9 +1458,9 @@ void PolicyManagerImpl::SendHMILevelChanged(const ApplicationOnDevice& who) { if (GetDefaultHmi(who.app_id, &default_hmi)) { listener()->OnUpdateHMIStatus(who.dev_id, who.app_id, default_hmi); } else { - LOG4CXX_WARN(logger_, - "Couldn't get default HMI level for application " - << who.app_id); + LOG4CXX_WARN( + logger_, + "Couldn't get default HMI level for application " << who.app_id); } } diff --git a/src/components/policy/policy_regular/src/policy_table/validation.cc b/src/components/policy/policy_regular/src/policy_table/validation.cc index 4db84e06ff..059c18d00e 100644 --- a/src/components/policy/policy_regular/src/policy_table/validation.cc +++ b/src/components/policy/policy_regular/src/policy_table/validation.cc @@ -7,7 +7,7 @@ bool IsTypeInvalid( rpc::Enum<rpc::policy_table_interface_base::RequestType> request) { return !request.is_valid(); } -} +} // namespace namespace rpc { namespace policy_table_interface_base { diff --git a/src/components/policy/policy_regular/src/sql_pt_representation.cc b/src/components/policy/policy_regular/src/sql_pt_representation.cc index c6f78d6d70..20ba9ec651 100644 --- a/src/components/policy/policy_regular/src/sql_pt_representation.cc +++ b/src/components/policy/policy_regular/src/sql_pt_representation.cc @@ -30,22 +30,22 @@ POSSIBILITY OF SUCH DAMAGE. */ -#include <sstream> -#include <stdlib.h> -#include <stdint.h> #include <errno.h> +#include <stdint.h> +#include <stdlib.h> #include <unistd.h> +#include <sstream> -#include "utils/logger.h" +#include "config_profile/profile.h" +#include "policy/cache_manager.h" +#include "policy/policy_helper.h" +#include "policy/sql_pt_queries.h" +#include "policy/sql_pt_representation.h" +#include "policy/sql_wrapper.h" #include "utils/date_time.h" #include "utils/file_system.h" #include "utils/gen_hash.h" -#include "policy/sql_pt_representation.h" -#include "policy/sql_wrapper.h" -#include "policy/sql_pt_queries.h" -#include "policy/policy_helper.h" -#include "policy/cache_manager.h" -#include "config_profile/profile.h" +#include "utils/logger.h" namespace policy { @@ -81,9 +81,9 @@ void SQLPTRepresentation::CheckPermissions(const PTString& app_id, utils::dbms::SQLQuery query(db()); if (!query.Prepare(sql_pt::kSelectRpc)) { - LOG4CXX_WARN(logger_, - "Incorrect select statement from rpcs" - << query.LastError().text()); + LOG4CXX_WARN( + logger_, + "Incorrect select statement from rpcs" << query.LastError().text()); return; } query.Bind(0, app_id); @@ -378,9 +378,9 @@ InitResult SQLPTRepresentation::Init(const PolicySettings* settings) { utils::dbms::SQLQuery check_first_run(db()); if (check_first_run.Prepare(sql_pt::kIsFirstRun) && check_first_run.Next()) { - LOG4CXX_INFO(logger_, - "Selecting is first run " - << check_first_run.GetBoolean(0)); + LOG4CXX_INFO( + logger_, + "Selecting is first run " << check_first_run.GetBoolean(0)); if (check_first_run.GetBoolean(0)) { utils::dbms::SQLQuery set_not_first_run(db()); set_not_first_run.Exec(sql_pt::kSetNotFirstRun); @@ -1125,9 +1125,9 @@ bool SQLPTRepresentation::SaveAppGroup( query.Bind(0, app_id); query.Bind(1, *it); if (!query.Exec() || !query.Reset()) { - LOG4CXX_WARN(logger_, - "Incorrect insert into app group." - << query.LastError().text()); + LOG4CXX_WARN( + logger_, + "Incorrect insert into app group." << query.LastError().text()); return false; } } diff --git a/src/components/policy/policy_regular/src/usage_statistics/counter.cc b/src/components/policy/policy_regular/src/usage_statistics/counter.cc index ed16fa3e8d..340f900cac 100644 --- a/src/components/policy/policy_regular/src/usage_statistics/counter.cc +++ b/src/components/policy/policy_regular/src/usage_statistics/counter.cc @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_POLICY_INCLUDE_POLICY_STATISTICS_MANAGER_H_ #define SRC_COMPONENTS_POLICY_INCLUDE_POLICY_STATISTICS_MANAGER_H_ -#include <cassert> #include "policy/usage_statistics/counter.h" +#include <cassert> #include "utils/date_time.h" #include "utils/timer_task_impl.h" diff --git a/src/components/policy/policy_regular/test/access_remote_impl_test.cc b/src/components/policy/policy_regular/test/access_remote_impl_test.cc index f79bb683f8..d9dba45ef2 100644 --- a/src/components/policy/policy_regular/test/access_remote_impl_test.cc +++ b/src/components/policy/policy_regular/test/access_remote_impl_test.cc @@ -30,8 +30,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "gtest/gtest.h" #include "policy/access_remote_impl.h" +#include "gtest/gtest.h" namespace policy { diff --git a/src/components/policy/policy_regular/test/counter_test.cc b/src/components/policy/policy_regular/test/counter_test.cc index d11bcec2ac..c09347fd9c 100644 --- a/src/components/policy/policy_regular/test/counter_test.cc +++ b/src/components/policy/policy_regular/test/counter_test.cc @@ -31,11 +31,11 @@ #include "gmock/gmock.h" -#include "policy/usage_statistics/mock_statistics_manager.h" #include "policy/usage_statistics/counter.h" +#include "policy/usage_statistics/mock_statistics_manager.h" -using ::testing::StrictMock; using ::testing::InSequence; +using ::testing::StrictMock; namespace test { namespace components { diff --git a/src/components/policy/policy_regular/test/include/policy/driver_dbms.h b/src/components/policy/policy_regular/test/include/policy/driver_dbms.h index 78b7add643..aa6fb0828b 100644 --- a/src/components/policy/policy_regular/test/include/policy/driver_dbms.h +++ b/src/components/policy/policy_regular/test/include/policy/driver_dbms.h @@ -152,7 +152,7 @@ class DBMS { }; #endif // __QNX__ -} // namespace policy +} // namespace policy_test } // namespace components } // namespace test diff --git a/src/components/policy/policy_regular/test/include/policy/mock_pt_representation.h b/src/components/policy/policy_regular/test/include/policy/mock_pt_representation.h index 72f183175c..44f7733985 100644 --- a/src/components/policy/policy_regular/test/include/policy/mock_pt_representation.h +++ b/src/components/policy/policy_regular/test/include/policy/mock_pt_representation.h @@ -37,9 +37,9 @@ #include "gmock/gmock.h" +#include "policy/policy_table/types.h" #include "policy/pt_representation.h" #include "rpc_base/rpc_base.h" -#include "policy/policy_table/types.h" namespace policy_table = ::rpc::policy_table_interface_base; diff --git a/src/components/policy/policy_regular/test/policy_manager_impl_test.cc b/src/components/policy/policy_regular/test/policy_manager_impl_test.cc index 97b1768666..39ff0efa7e 100644 --- a/src/components/policy/policy_regular/test/policy_manager_impl_test.cc +++ b/src/components/policy/policy_regular/test/policy_manager_impl_test.cc @@ -30,39 +30,38 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include <vector> +#include <ctime> #include <fstream> #include <string> -#include <ctime> +#include <vector> +#include "gtest/gtest.h" #include "json/reader.h" #include "json/writer.h" -#include "gtest/gtest.h" #include "config_profile/profile.h" +#include "policy/mock_cache_manager.h" +#include "policy/mock_policy_listener.h" +#include "policy/mock_policy_settings.h" +#include "policy/mock_update_status_manager.h" #include "policy/policy_manager_impl.h" #include "policy/policy_table/enums.h" #include "policy/policy_table/types.h" -#include "policy/mock_policy_settings.h" -#include "policy/mock_policy_listener.h" -#include "policy/mock_cache_manager.h" -#include "policy/mock_update_status_manager.h" -#include "utils/macro.h" -#include "utils/file_system.h" #include "utils/date_time.h" +#include "utils/file_system.h" +#include "utils/macro.h" -#include "utils/gen_hash.h" #include "policy/mock_access_remote.h" +#include "utils/gen_hash.h" -using ::testing::ReturnRef; -using ::testing::DoAll; -using ::testing::SetArgReferee; -using ::testing::NiceMock; using ::testing::_; -using ::testing::SetArgReferee; using ::testing::AtLeast; +using ::testing::DoAll; +using ::testing::NiceMock; using ::testing::Return; +using ::testing::ReturnRef; +using ::testing::SetArgReferee; using ::policy::PolicyManagerImpl; using ::policy::PolicyTable; @@ -932,9 +931,8 @@ TEST_F(PolicyManagerImplTest2, NextRetryTimeout_ExpectTimeoutsFromPT) { date_time::MILLISECONDS_IN_SECOND; const uint32_t first_retry = timeout_after_x_seconds; EXPECT_EQ(first_retry, manager->NextRetryTimeout()); - uint32_t next_retry = - first_retry + - seconds_between_retries[0].asInt() * date_time::MILLISECONDS_IN_SECOND; + uint32_t next_retry = first_retry + seconds_between_retries[0].asInt() * + date_time::MILLISECONDS_IN_SECOND; EXPECT_EQ(next_retry, manager->NextRetryTimeout()); next_retry = first_retry + next_retry + @@ -977,9 +975,8 @@ TEST_F(PolicyManagerImplTest2, UpdatedPreloadedPT_ExpectLPT_IsUpdated) { Json::Value val2(Json::arrayValue); val2[0] = hmi_level[index]; val[new_data.new_field_value_]["hmi_levels"] = val2; - root["policy_table"]["functional_groupings"][new_data - .new_field_name_]["rpcs"] = - val; + root["policy_table"]["functional_groupings"][new_data.new_field_name_] + ["rpcs"] = val; root["policy_table"]["functional_groupings"][new_data.new_field_name_] ["user_consent_prompt"] = new_data.new_field_name_; } diff --git a/src/components/policy/policy_regular/test/sql_pt_representation_test.cc b/src/components/policy/policy_regular/test/sql_pt_representation_test.cc index 675d708843..dc11e11f12 100644 --- a/src/components/policy/policy_regular/test/sql_pt_representation_test.cc +++ b/src/components/policy/policy_regular/test/sql_pt_representation_test.cc @@ -29,39 +29,39 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include <vector> -#include <string> +#include <stdio.h> +#include <sys/stat.h> #include <algorithm> #include <fstream> #include <memory> -#include <stdio.h> -#include <sys/stat.h> +#include <string> +#include <vector> #include "gtest/gtest.h" +#include "json/reader.h" +#include "json/writer.h" #include "policy/driver_dbms.h" -#include "policy/sql_pt_representation.h" -#include "policy/policy_types.h" #include "policy/mock_policy_settings.h" -#include "policy/policy_table/types.h" #include "policy/policy_table/enums.h" -#include "json/writer.h" -#include "json/reader.h" +#include "policy/policy_table/types.h" +#include "policy/policy_types.h" +#include "policy/sql_pt_representation.h" #include "rpc_base/rpc_base.h" #include "utils/file_system.h" #include "utils/sqlite_wrapper/sql_database.h" namespace policy_table = rpc::policy_table_interface_base; -using policy::SQLPTRepresentation; using policy::CheckPermissionResult; -using policy::UserFriendlyMessage; using policy::EndpointUrls; +using policy::SQLPTRepresentation; +using policy::UserFriendlyMessage; using policy::VehicleInfo; -using testing::ReturnRef; -using testing::Return; -using testing::NiceMock; using testing::Mock; +using testing::NiceMock; +using testing::Return; +using testing::ReturnRef; namespace test { namespace components { diff --git a/src/components/policy/policy_regular/test/update_status_manager_test.cc b/src/components/policy/policy_regular/test/update_status_manager_test.cc index 244858554f..459913fe72 100644 --- a/src/components/policy/policy_regular/test/update_status_manager_test.cc +++ b/src/components/policy/policy_regular/test/update_status_manager_test.cc @@ -30,10 +30,10 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#include "policy/update_status_manager.h" #include "gtest/gtest.h" #include "policy/mock_policy_listener.h" #include "policy/policy_manager_impl.h" -#include "policy/update_status_manager.h" namespace test { namespace components { |