summaryrefslogtreecommitdiff
path: root/src/components/policy/policy_external/include
diff options
context:
space:
mode:
authorYevhenii Dementieiev (GitHub) <57259850+ydementieiev@users.noreply.github.com>2020-02-28 22:03:44 +0200
committerGitHub <noreply@github.com>2020-02-28 15:03:44 -0500
commitce12181630c0923cf821bfa314d46be02e5380bc (patch)
tree5116ed78739b31d6bf8b853a0557df92915e133c /src/components/policy/policy_external/include
parentdd39efa5cf98baba8cf189d2992842f45cef64dc (diff)
downloadsdl_core-ce12181630c0923cf821bfa314d46be02e5380bc.tar.gz
Start the new PTU after a failed retry sequence (#3208)
* Start the new PTU after a failed retry sequence in case some trigger occurs during the retry sequence Co-authored-by: Dmytro Boltovskyi (GitHub) <dboltovskyi@luxoft.com>
Diffstat (limited to 'src/components/policy/policy_external/include')
-rw-r--r--src/components/policy/policy_external/include/policy/policy_manager_impl.h17
-rw-r--r--src/components/policy/policy_external/include/policy/update_status_manager.h7
2 files changed, 24 insertions, 0 deletions
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 57499131f9..bf23429106 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
@@ -608,6 +608,8 @@ class PolicyManagerImpl : public PolicyManager {
*/
void OnAppsSearchCompleted(const bool trigger_ptu) OVERRIDE;
+ void UpdatePTUReadyAppsCount(const uint32_t new_app_count) OVERRIDE;
+
/**
* @brief Get state of request types for given application
* @param policy_app_id Unique application id
@@ -1080,6 +1082,11 @@ class PolicyManagerImpl : public PolicyManager {
policy_table::PolicyTableType type) const;
/**
+ * @brief Check that new applications for PTU were registered
+ */
+ bool HasApplicationForPTU() const;
+
+ /**
* @brief Get resulting RPCs permissions for application which started on
* specific device
* @param device_id Device id
@@ -1294,6 +1301,11 @@ class PolicyManagerImpl : public PolicyManager {
uint32_t retry_sequence_index_;
/**
+ * @brief Applications pending count ready for PTU
+ */
+ uint32_t applications_pending_ptu_count_;
+
+ /**
* @brief Lock for guarding retry sequence
*/
mutable sync_primitives::Lock retry_sequence_lock_;
@@ -1335,6 +1347,11 @@ class PolicyManagerImpl : public PolicyManager {
bool trigger_ptu_;
/**
+ * @brief Flag for notifying that PTU was requested
+ */
+ bool ptu_requested_;
+
+ /**
* @brief Flag that indicates whether a PTU sequence (including retries) is in
* progress
*/
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 9426a26fb8..018bab7f99 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
@@ -92,6 +92,12 @@ class UpdateStatusManager {
void OnUpdateTimeoutOccurs();
/**
+ * @brief Update status for next in queue application
+ * after previous update been has finished
+ */
+ void OnUpdateForNextInQueue();
+
+ /**
* @brief Update status handler for valid PTU receiving
*/
void OnValidUpdateReceived();
@@ -222,6 +228,7 @@ class UpdateStatusManager {
UpdateEvent last_processed_event_;
bool apps_search_in_progress_;
bool app_registered_from_non_consented_device_;
+ bool last_update_was_failed_;
sync_primitives::Lock apps_search_in_progress_lock_;
class UpdateThreadDelegate : public threads::ThreadDelegate {