diff options
Diffstat (limited to 'src/components/policy/src/policy/include/policy/policy_manager_impl.h')
-rw-r--r-- | src/components/policy/src/policy/include/policy/policy_manager_impl.h | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/components/policy/src/policy/include/policy/policy_manager_impl.h b/src/components/policy/src/policy/include/policy/policy_manager_impl.h index 1c7f0d4ed7..78688c8fd5 100644 --- a/src/components/policy/src/policy/include/policy/policy_manager_impl.h +++ b/src/components/policy/src/policy/include/policy/policy_manager_impl.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, Ford Motor Company + Copyright (c) 2016, Ford Motor Company All rights reserved. Redistribution and use in source and binary forms, with or without @@ -34,6 +34,8 @@ #define SRC_COMPONENTS_POLICY_INCLUDE_POLICY_POLICY_MANAGER_IMPL_H_ #include <list> +#include <cstdint> + #include "utils/shared_ptr.h" #include "utils/lock.h" #include "policy/policy_manager.h" @@ -42,6 +44,8 @@ #include "policy/update_status_manager.h" #include "./functions.h" #include "usage_statistics/statistics_manager.h" +#include "policy/policy_helper.h" +#include "utils/timer_thread.h" namespace policy_table = rpc::policy_table_interface_base; @@ -61,7 +65,7 @@ public: EndpointUrls &end_points); virtual std::string GetLockScreenIconUrl() const; - virtual void RequestPTUpdate(); + virtual bool RequestPTUpdate(); virtual void CheckPermissions(const PTString &app_id, const PTString &hmi_level, const PTString &rpc, const RPCParams &rpc_params, @@ -72,7 +76,7 @@ public: virtual std::string ForcePTExchange(); virtual std::string GetPolicyTableStatus() const; virtual void ResetRetrySequence(); - virtual int NextRetryTimeout(); + virtual uint32_t NextRetryTimeout(); virtual int TimeoutExchange(); virtual const std::vector<int> RetrySequenceDelaysSeconds(); virtual void OnExceededTimeout(); @@ -271,6 +275,8 @@ private: bool IsPTValid(utils::SharedPtr<policy_table::Table> policy_table, policy_table::PolicyTableType type) const; + void RetrySequence(); + private: PolicyListener *listener_; @@ -283,7 +289,7 @@ private: /** * Timeout to wait response with UpdatePT */ - int retry_sequence_timeout_; + uint32_t retry_sequence_timeout_; /** * Seconds between retries to update PT @@ -301,6 +307,11 @@ private: sync_primitives::Lock retry_sequence_lock_; /** + * Timer to retry UpdatePT + */ + timer::TimerThread<PolicyManagerImpl> timer_retry_sequence_; + + /** * Lock for guarding recording statistics */ sync_primitives::Lock statistics_lock_; |