summaryrefslogtreecommitdiff
path: root/src/components/policy
diff options
context:
space:
mode:
authorIgor Gapchuk (GitHub) <41586842+IGapchuk@users.noreply.github.com>2019-09-12 18:03:05 +0300
committerCollin <iCollin@users.noreply.github.com>2019-09-12 11:03:05 -0400
commit2449d7e0e71db6cc07f50fd427a4a5a7dd037015 (patch)
tree0492ab921951559a6e029fc9dc855e2d501698e9 /src/components/policy
parent5b9e0c0ade33c1eb1a30de14fdc64f5efeaf9cc8 (diff)
downloadsdl_core-2449d7e0e71db6cc07f50fd427a4a5a7dd037015.tar.gz
Fix SDL's core crash during retry sequence (#3020)
* Fix SDL crash during retry sequence In case, when lust application is unregistered, SDL has to stop retry sequence, because doesn't exist any mobile connection and these actions are redundant. Also SDL should check if exist registered applications before sending PolicySnapshotNotification. * fixup! Fix SDL crash during retry sequence * fixup! Fix SDL crash during retry sequence
Diffstat (limited to 'src/components/policy')
-rw-r--r--src/components/policy/policy_external/include/policy/policy_manager_impl.h2
-rw-r--r--src/components/policy/policy_external/src/policy_manager_impl.cc6
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_manager_impl.h2
-rw-r--r--src/components/policy/policy_regular/src/policy_manager_impl.cc10
4 files changed, 20 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 497394886f..321294aa3d 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
@@ -207,6 +207,8 @@ class PolicyManagerImpl : public PolicyManager {
*/
std::string ForcePTExchange() OVERRIDE;
+ void StopRetrySequence() OVERRIDE;
+
/**
* @brief Exchange by user request
* @return Current status of policy table
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 9b9d300d78..95d3011b33 100644
--- a/src/components/policy/policy_external/src/policy_manager_impl.cc
+++ b/src/components/policy/policy_external/src/policy_manager_impl.cc
@@ -1877,6 +1877,12 @@ std::string PolicyManagerImpl::ForcePTExchange() {
return update_status_manager_.StringifiedUpdateStatus();
}
+void policy::PolicyManagerImpl::StopRetrySequence() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ResetRetrySequence(ResetRetryCountType::kResetWithStatusUpdate);
+}
+
std::string PolicyManagerImpl::ForcePTExchangeAtUserRequest() {
LOG4CXX_AUTO_TRACE(logger_);
update_status_manager_.ScheduleManualUpdate();
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 0bc311ba9f..542f33794b 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
@@ -237,6 +237,8 @@ class PolicyManagerImpl : public PolicyManager {
*/
std::string ForcePTExchange() OVERRIDE;
+ void StopRetrySequence() OVERRIDE;
+
/**
* @brief Exchange by user request
* @return Current status of policy table
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 0e1cfd267a..9e5cf01493 100644
--- a/src/components/policy/policy_regular/src/policy_manager_impl.cc
+++ b/src/components/policy/policy_regular/src/policy_manager_impl.cc
@@ -1229,6 +1229,16 @@ std::string PolicyManagerImpl::ForcePTExchange() {
return update_status_manager_.StringifiedUpdateStatus();
}
+void PolicyManagerImpl::StopRetrySequence() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (timer_retry_sequence_.is_running()) {
+ timer_retry_sequence_.Stop();
+ }
+
+ ResetRetrySequence(ResetRetryCountType::kResetWithStatusUpdate);
+}
+
std::string PolicyManagerImpl::ForcePTExchangeAtUserRequest() {
update_status_manager_.ScheduleManualUpdate();
StartPTExchange();