diff options
author | Teodora Kireva <tkireva@luxoft.com> | 2017-02-28 14:10:22 +0200 |
---|---|---|
committer | Ira Lytvynenko <ILytvynenko@luxoft.com> | 2017-04-12 19:11:11 +0300 |
commit | aa0e719035c4ab394b73896d496bc5cf29ddde93 (patch) | |
tree | ddba2f1aacc18c06296ff2c59c35ed6f640d7a73 /src | |
parent | 195ae7d4911a9f23b5a468c4c30335667f351fb0 (diff) | |
download | sdl_core-aa0e719035c4ab394b73896d496bc5cf29ddde93.tar.gz |
Fix conflicts after rebasing
Conflicts after rebasing to feature/extended_policy_functionality
are fixed.
Conflicts:
src/components/include/policy/policy_regular/policy/policy_manager.h
src/components/policy/policy_external/src/policy_manager_impl.cc
src/components/policy/policy_regular/include/policy/policy_manager_impl.h
Diffstat (limited to 'src')
6 files changed, 50 insertions, 8 deletions
diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc index 5dce762bf7..ab09bbc23c 100644 --- a/src/components/application_manager/src/policies/policy_handler.cc +++ b/src/components/application_manager/src/policies/policy_handler.cc @@ -484,6 +484,12 @@ void PolicyHandler::GetAvailableApps(std::queue<std::string>& apps) { } } +struct SmartObjectToInt { + int operator()(const smart_objects::SmartObject& item) const { + return item.asInt(); + } +}; + StatusNotifier PolicyHandler::AddApplication( const std::string& application_id) { POLICY_LIB_CHECK(utils::MakeShared<utils::CallNothing>()); diff --git a/src/components/include/policy/policy_external/policy/policy_manager.h b/src/components/include/policy/policy_external/policy/policy_manager.h index 6928133775..6028a1674e 100644 --- a/src/components/include/policy/policy_external/policy/policy_manager.h +++ b/src/components/include/policy/policy_external/policy/policy_manager.h @@ -488,6 +488,19 @@ class PolicyManager : public usage_statistics::StatisticsManager { * urls vector */ virtual AppIdURL GetNextUpdateUrl(const EndpointUrls& urls) = 0; + + /** + * @brief Checks if there is existing URL in the EndpointUrls vector with + * index saved in the policy manager and if not, it moves to the next + * application index + * @param rs contains the application index and url index from the + * urls vector that are to be sent on the next OnSystemRequest + * @param urls vector of vectors that contain urls for each application + * @return Pair of application index and url index + */ + virtual AppIdURL RetrySequenceUrl(const struct RetrySequenceURL& rs, + const EndpointUrls& urls) const = 0; + protected: /** * Checks is PT exceeded IgnitionCycles diff --git a/src/components/include/policy/policy_regular/policy/policy_manager.h b/src/components/include/policy/policy_regular/policy/policy_manager.h index 0bd72faaae..fcdf48e8cf 100644 --- a/src/components/include/policy/policy_regular/policy/policy_manager.h +++ b/src/components/include/policy/policy_regular/policy/policy_manager.h @@ -457,6 +457,26 @@ class PolicyManager : public usage_statistics::StatisticsManager { virtual const PolicySettings& get_settings() const = 0; + /** + * @brief Finds the next URL that must be sent on OnSystemRequest retry + * @param urls vector of vectors that contain urls for each application + * @return Pair of policy application id and application url id from the + * urls vector + */ + virtual AppIdURL GetNextUpdateUrl(const EndpointUrls& urls) = 0; + + /** + * @brief Checks if there is existing URL in the EndpointUrls vector with + * index saved in the policy manager and if not, it moves to the next + * application index + * @param rs contains the application index and url index from the + * urls vector that are to be sent on the next OnSystemRequest + * @param urls vector of vectors that contain urls for each application + * @return Pair of application index and url index + */ + virtual AppIdURL RetrySequenceUrl(const struct RetrySequenceURL& rs, + const EndpointUrls& urls) const = 0; + protected: /** * Checks is PT exceeded IgnitionCycles 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 1db21bf7d2..3abf02927c 100644 --- a/src/components/policy/policy_external/src/policy_manager_impl.cc +++ b/src/components/policy/policy_external/src/policy_manager_impl.cc @@ -67,7 +67,7 @@ PolicyManagerImpl::PolicyManagerImpl() , retry_sequence_timeout_(60) , retry_sequence_index_(0) , ignition_check(true) - , retry_sequence_url_(0, 0) { + , retry_sequence_url_(0, 0, "") { } PolicyManagerImpl::PolicyManagerImpl(bool in_memory) @@ -76,7 +76,9 @@ PolicyManagerImpl::PolicyManagerImpl(bool in_memory) , cache_(new CacheManager(in_memory)) , retry_sequence_timeout_(60) , retry_sequence_index_(0) - , ignition_check(true) {} + , ignition_check(true) + , retry_sequence_url_(0, 0, "") { +} void PolicyManagerImpl::set_listener(PolicyListener* listener) { listener_ = listener; 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 f7946e84a0..28947a6343 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 @@ -173,6 +173,7 @@ class PolicyManagerImpl : public PolicyManager { StatusNotifier AddApplication(const std::string& application_id); + virtual void RemoveAppConsentForGroup(const std::string& app_id, const std::string& group_name); @@ -202,6 +203,11 @@ class PolicyManagerImpl : public PolicyManager { virtual std::string RetrieveCertificate() const OVERRIDE; + AppIdURL GetNextUpdateUrl(const EndpointUrls& urls) OVERRIDE; + + AppIdURL RetrySequenceUrl(const struct RetrySequenceURL& rs, + const EndpointUrls& urls) const OVERRIDE; + protected: #ifdef USE_HMI_PTU_DECRYPTION virtual utils::SharedPtr<policy_table::Table> Parse( @@ -213,11 +219,6 @@ class PolicyManagerImpl : public PolicyManager { const PolicySettings& get_settings() const OVERRIDE; - AppIdURL GetNextUpdateUrl(const EndpointUrls& urls) OVERRIDE; - - AppIdURL RetrySequenceUrl(const struct RetrySequenceURL& rs, - const EndpointUrls& urls) const OVERRIDE; - private: void CheckTriggers(); /* 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 19755e3f15..b73aea71ba 100644 --- a/src/components/policy/policy_regular/src/policy_manager_impl.cc +++ b/src/components/policy/policy_regular/src/policy_manager_impl.cc @@ -77,7 +77,7 @@ PolicyManagerImpl::PolicyManagerImpl() new timer::TimerTaskImpl<PolicyManagerImpl>( this, &PolicyManagerImpl::RetrySequence)) , ignition_check(true) - , retry_sequence_url_(0, 0) { + , retry_sequence_url_(0, 0, "") { } void PolicyManagerImpl::set_listener(PolicyListener* listener) { |