diff options
author | Andrey Oleynik <aoleynik@luxoft.com> | 2015-12-22 12:13:29 +0200 |
---|---|---|
committer | Andrey Oleynik <aoleynik@luxoft.com> | 2016-01-20 12:28:12 +0200 |
commit | 9dd9ce9c2bf620f3044ac7e6de048263ed72bf24 (patch) | |
tree | 71accbe09fb3c2ab841dba9c717f338e430e6ef5 /src/components/application_manager/include/application_manager/resumption | |
parent | d703087580ac41a1a38f63785a13f08fa4b5a9e5 (diff) | |
download | sdl_core-9dd9ce9c2bf620f3044ac7e6de048263ed72bf24.tar.gz |
Fixes skipping of resumption on multiple igntion cycles
Incorrect check on ignition cycles number caused wrong setting of HMI
levels and skipping of resumption on multiple ignition cycles. In case
of multiple apps with FULL/LIMITED only one got correct level after
loading data from disk. Also data resumption was never expired, which is wrong.
Closes-bug: APPLINK-20123
Conflicts:
src/components/application_manager/include/application_manager/resumption/resumption_data_db.h
src/components/application_manager/src/resumption/resume_ctrl.cc
Diffstat (limited to 'src/components/application_manager/include/application_manager/resumption')
4 files changed, 24 insertions, 1 deletions
diff --git a/src/components/application_manager/include/application_manager/resumption/resume_ctrl.h b/src/components/application_manager/include/application_manager/resumption/resume_ctrl.h index d235aa3d8a..092aa3cdec 100644 --- a/src/components/application_manager/include/application_manager/resumption/resume_ctrl.h +++ b/src/components/application_manager/include/application_manager/resumption/resume_ctrl.h @@ -423,6 +423,14 @@ class ResumeCtrl: public app_mngr::event_engine::EventObserver { void LoadResumeData(); /** + * @brief Checks, if application data needs to be resumed + * @param application Application data from storage + * @return true, if data resumption must be skipped, otherwise - false + */ + bool IsAppDataResumptionExpired( + const smart_objects::SmartObject& application) const; + + /** *@brief Mapping applications to time_stamps * wait for timer to resume HMI Level * diff --git a/src/components/application_manager/include/application_manager/resumption/resumption_data.h b/src/components/application_manager/include/application_manager/resumption/resumption_data.h index ca5f5afe6f..c9dbe8dcab 100644 --- a/src/components/application_manager/include/application_manager/resumption/resumption_data.h +++ b/src/components/application_manager/include/application_manager/resumption/resumption_data.h @@ -183,10 +183,19 @@ class ResumptionData { mobile_apis::HMILevel::eType hmi_level) = 0; /** - * @brief Uses for overload on heir classes + * @brief Init storage */ virtual bool Init(); + /** + * @brief Drops data related to applicaton data resumption + * @param device_id Device ID + * @param app_id Application ID + * @return true, if dropped successfully, otherwise - false + */ + virtual bool DropAppDataResumption(const std::string& device_id, + const std::string& app_id) = 0; + protected: /** * @brief Retrieves of commands from application diff --git a/src/components/application_manager/include/application_manager/resumption/resumption_data_db.h b/src/components/application_manager/include/application_manager/resumption/resumption_data_db.h index 2bf1cb6cf8..d3642296fe 100644 --- a/src/components/application_manager/include/application_manager/resumption/resumption_data_db.h +++ b/src/components/application_manager/include/application_manager/resumption/resumption_data_db.h @@ -232,6 +232,9 @@ class ResumptionDataDB : public ResumptionData { */ bool UpdateDBVersion() const; + bool DropAppDataResumption(const std::string& device_id, + const std::string& app_id) OVERRIDE; + private: /** * @brief Calculates DB version from current schema diff --git a/src/components/application_manager/include/application_manager/resumption/resumption_data_json.h b/src/components/application_manager/include/application_manager/resumption/resumption_data_json.h index 769ee321c2..f5775ac004 100644 --- a/src/components/application_manager/include/application_manager/resumption/resumption_data_json.h +++ b/src/components/application_manager/include/application_manager/resumption/resumption_data_json.h @@ -179,6 +179,9 @@ class ResumptionDataJson : public ResumptionData { virtual bool Init(); + bool DropAppDataResumption(const std::string& device_id, + const std::string& app_id) OVERRIDE; + private: /** * @brief GetFromSavedOrAppend allows to get existed record about application |