diff options
author | AKalinich-Luxoft <AKalinich@luxoft.com> | 2017-06-09 09:39:12 +0300 |
---|---|---|
committer | AKalinich-Luxoft <AKalinich@luxoft.com> | 2017-12-12 14:10:29 +0200 |
commit | 2f22052761aed0069b9a7fc99c0ffee1e60822c0 (patch) | |
tree | 9f7e50486584cf6d7b0328efa941fcd318d97cbb /src/components/application_manager/include/application_manager | |
parent | 6153f79de2c362dd51c3e945294b74cd9f965ac5 (diff) | |
download | sdl_core-2f22052761aed0069b9a7fc99c0ffee1e60822c0.tar.gz |
Added OnIgnitionOff() and new bool flag to ResumeCtrl class
SDL should distinct ignition off and suspend notifications.
SDL should not increment ignition off count in case of suspended
notification, only in case of ignition off.
This logic was separated by appending new function OnIgnitionOff()
which will be called from application manager on ignition off instead
of OnSuspend().
Also was added is_suspended flag and related getter/setter.
This flag is used in:
- ApplicationImpl to check should SDL send OnHashChange or not
- In OnAwakeSDLNotification to check should SDL do OnAwake actions or not
- OnExitAllApplicationsNotification and OnAwakeSDLNotification switches this flag
Also was fixed some related UT expectations and mocks.
Diffstat (limited to 'src/components/application_manager/include/application_manager')
2 files changed, 47 insertions, 0 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 26b1739a38..298992c907 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 @@ -115,11 +115,34 @@ class ResumeCtrl { virtual void OnSuspend() = 0; /** + * @brief Processes resumption data after receiving signal "Ignition Off" + */ + virtual void OnIgnitionOff() = 0; + + /** * @brief Processes resumption data after receiving signal "Awake" */ virtual void OnAwake() = 0; /** + * @brief Retrieves value of is_suspended_ + * + * @return Returns TRUE if SDL has received OnExitAllApplication notification + * with reason "SUSPEND" otherwise returns FALSE + */ + virtual bool is_suspended() const = 0; + + /** + * @brief Sets value of is_suspended_ + * + * @param contains TRUE if method is called when SDL has received + * OnExitAllApplication notification with reason "SUSPEND" + * contains FALSE if method is called when SDL has received + * OnAwakeSDL notification. + */ + virtual void set_is_suspended(const bool suspended_flag) = 0; + + /** * @brief Method stops timer "RsmCtrlPercist" when SDL * receives OnExitAllApplication notification * with reason "SUSPEND" diff --git a/src/components/application_manager/include/application_manager/resumption/resume_ctrl_impl.h b/src/components/application_manager/include/application_manager/resumption/resume_ctrl_impl.h index bb886cd5f6..dd0c5836b8 100644 --- a/src/components/application_manager/include/application_manager/resumption/resume_ctrl_impl.h +++ b/src/components/application_manager/include/application_manager/resumption/resume_ctrl_impl.h @@ -129,11 +129,34 @@ class ResumeCtrlImpl : public ResumeCtrl, void OnSuspend() OVERRIDE; /** + * @brief Processes resumption data after receiving signal "Ignition Off" + */ + void OnIgnitionOff() OVERRIDE; + + /** * @brief Processes resumption data after receiving signal "Awake" */ void OnAwake() OVERRIDE; /** + * @brief Retrieves value of is_suspended_ + * + * @return Returns TRUE if SDL has received OnExitAllApplication notification + * with reason "SUSPEND" otherwise returns FALSE + */ + bool is_suspended() const OVERRIDE; + + /** + * @brief Sets value of is_suspended_ + * + * @param contains TRUE if method is called when SDL has received + * OnExitAllApplication notification with reason "SUSPEND" + * contains FALSE if method is called when SDL has received + * OnAwakeSDL notification. + */ + void set_is_suspended(const bool suspended_flag) OVERRIDE; + + /** * @brief Method stops timer "RsmCtrlPercist" when SDL * receives OnExitAllApplication notification * with reason "SUSPEND" @@ -491,6 +514,7 @@ class ResumeCtrlImpl : public ResumeCtrl, WaitingForTimerList waiting_for_timer_; bool is_resumption_active_; bool is_data_saved_; + bool is_suspended_; time_t launch_time_; utils::SharedPtr<ResumptionData> resumption_storage_; application_manager::ApplicationManager& application_manager_; |