summaryrefslogtreecommitdiff
path: root/src/components/application_manager/src/resumption/resume_ctrl_impl.cc
diff options
context:
space:
mode:
authorAKalinich-Luxoft <AKalinich@luxoft.com>2017-06-27 12:05:14 +0300
committerAKalinich-Luxoft <AKalinich@luxoft.com>2017-12-12 14:11:47 +0200
commit3baea565f75bfc8cebacccc0bc04045af076e7f8 (patch)
tree95ee77a53ccc56fb45246c29ab006771b1ee95be /src/components/application_manager/src/resumption/resume_ctrl_impl.cc
parent4fe39afab7101e50f51415a20507821e2775387e (diff)
downloadsdl_core-3baea565f75bfc8cebacccc0bc04045af076e7f8.tar.gz
Removed is_suspended setter.
is_suspended flag was encapsulated inside resumption controller Updated mocks
Diffstat (limited to 'src/components/application_manager/src/resumption/resume_ctrl_impl.cc')
-rw-r--r--src/components/application_manager/src/resumption/resume_ctrl_impl.cc19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/components/application_manager/src/resumption/resume_ctrl_impl.cc b/src/components/application_manager/src/resumption/resume_ctrl_impl.cc
index bf7a365b9e..435e621169 100644
--- a/src/components/application_manager/src/resumption/resume_ctrl_impl.cc
+++ b/src/components/application_manager/src/resumption/resume_ctrl_impl.cc
@@ -264,19 +264,19 @@ bool ResumeCtrlImpl::RemoveApplicationFromSaved(
void ResumeCtrlImpl::OnSuspend() {
LOG4CXX_AUTO_TRACE(logger_);
- StopSavePersistentDataTimer();
- SaveAllApplications();
- resumption_storage_->Persist();
+ is_suspended_ = true;
+ FinalPersistData();
}
void ResumeCtrlImpl::OnIgnitionOff() {
LOG4CXX_AUTO_TRACE(logger_);
resumption_storage_->IncrementIgnOffCount();
- OnSuspend();
+ FinalPersistData();
}
void ResumeCtrlImpl::OnAwake() {
LOG4CXX_AUTO_TRACE(logger_);
+ is_suspended_ = false;
ResetLaunchTime();
StartSavePersistentDataTimer();
}
@@ -285,10 +285,6 @@ bool ResumeCtrlImpl::is_suspended() const {
return is_suspended_;
}
-void ResumeCtrlImpl::set_is_suspended(const bool suspended_flag) {
- is_suspended_ = suspended_flag;
-}
-
void ResumeCtrlImpl::StartSavePersistentDataTimer() {
LOG4CXX_AUTO_TRACE(logger_);
if (!save_persistent_data_timer_.is_running()) {
@@ -447,6 +443,13 @@ void ResumeCtrlImpl::SaveDataOnTimer() {
}
}
+void ResumeCtrlImpl::FinalPersistData() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ StopSavePersistentDataTimer();
+ SaveAllApplications();
+ resumption_storage_->Persist();
+}
+
bool ResumeCtrlImpl::IsDeviceMacAddressEqual(
ApplicationSharedPtr application, const std::string& saved_device_mac) {
LOG4CXX_AUTO_TRACE(logger_);