diff options
Diffstat (limited to 'src/components/application_manager/src')
3 files changed, 27 insertions, 5 deletions
diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index 088e69c22..c6a0cadf6 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -548,6 +548,11 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication( : GenerateNewHMIAppID()); } + // Stops timer of saving data to resumption in order to + // doesn't erase data from resumption storage. + // Timer will be started after hmi level resumption. + resume_ctrl_.OnAppRegistrationStart(policy_app_id, device_mac); + // Add application to registered app list and set appropriate mark. // Lock has to be released before adding app to policy DB to avoid possible // deadlock with simultaneous PTU processing diff --git a/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc b/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc index 9ef30c295..b0393ac6f 100644 --- a/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc +++ b/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc @@ -327,9 +327,11 @@ void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile() { ApplicationSharedPtr application = ApplicationManagerImpl::instance()->application(key); + resumption::ResumeCtrl& resumer = ApplicationManagerImpl::instance()->resume_controller(); if (!application) { - LOG4CXX_ERROR(logger_, - "There is no application for such connection key" << key); + LOG4CXX_ERROR(logger_, "There is no application for such connection key" << key); + LOG4CXX_DEBUG(logger_, "Need to start resume data persistent timer"); + resumer.OnAppRegistrationEnd(); return; } @@ -503,9 +505,6 @@ void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile() { std::string hash_id; std::string add_info; - resumption::ResumeCtrl& resumer = - ApplicationManagerImpl::instance()->resume_controller(); - if (resumption) { hash_id = (*message_)[strings::msg_params][strings::hash_id].asString(); if (!resumer.CheckApplicationHash(application, hash_id)) { diff --git a/src/components/application_manager/src/resumption/resume_ctrl.cc b/src/components/application_manager/src/resumption/resume_ctrl.cc index 926c98808..8c4c26389 100644 --- a/src/components/application_manager/src/resumption/resume_ctrl.cc +++ b/src/components/application_manager/src/resumption/resume_ctrl.cc @@ -182,6 +182,7 @@ void ResumeCtrl::ApplicationResumptiOnTimer() { } is_resumption_active_ = false; waiting_for_timer_.clear(); + StartSavePersistentDataTimer(); } void ResumeCtrl::OnAppActivated(ApplicationSharedPtr application) { @@ -747,10 +748,27 @@ void ResumeCtrl::LoadResumeData() { } } +void ResumeCtrl::OnAppRegistrationStart(const std::string& policy_app_id, + const std::string& device_id) { + LOG4CXX_AUTO_TRACE(logger_); + if (IsApplicationSaved(policy_app_id, device_id)) { + LOG4CXX_INFO(logger_, "Application is found in resumption " + "data and will try to resume. Stopping resume data persistent timer"); + StopSavePersistentDataTimer(); + } +} + +void ResumeCtrl::OnAppRegistrationEnd() { + LOG4CXX_AUTO_TRACE(logger_); + StartSavePersistentDataTimer(); +} + bool ResumeCtrl::IsAppDataResumptionExpired( const smart_objects::SmartObject& application) const { const int32_t max_ign_off_count = 3; return max_ign_off_count <= application[strings::ign_off_count].asInt(); } + + } // namespce resumption |