summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYana Chernysheva (GitHub) <59469418+ychernysheva@users.noreply.github.com>2021-01-14 20:46:39 +0200
committerGitHub <noreply@github.com>2021-01-14 13:46:39 -0500
commit44e7e5d49466302dd063489d9efc27a9f369de80 (patch)
tree29e5002142bc3b1bdb7963d39892ae6574540d1f
parent721913c182212f97b46e51746efcddc951771514 (diff)
downloadsdl_core-44e7e5d49466302dd063489d9efc27a9f369de80.tar.gz
Fix issue with resumption after unexpected disconnect in current ignition cycle (#3608)
-rw-r--r--src/components/application_manager/src/resumption/resume_ctrl_impl.cc26
1 files changed, 20 insertions, 6 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 6a045fda03..bc373d48c9 100644
--- a/src/components/application_manager/src/resumption/resume_ctrl_impl.cc
+++ b/src/components/application_manager/src/resumption/resume_ctrl_impl.cc
@@ -514,16 +514,30 @@ void ResumeCtrlImpl::StartAppHmiStateResumption(
const bool is_resume_allowed_by_low_voltage =
CheckLowVoltageRestrictions(saved_app);
- const bool is_hmi_level_allowed_by_ign_cycle =
- CheckIgnCycleRestrictions(saved_app);
-
+ const time_t sdl_launch_time = LaunchTime();
+ const bool is_unexpected_disconnect_in_current_ign_cycle =
+ sdl_launch_time < saved_app[strings::time_stamp].asInt();
+ SDL_LOG_DEBUG("sdl_launch_time: " << sdl_launch_time
+ << ", App disconnect time: "
+ << saved_app[strings::time_stamp].asInt());
const bool is_app_revoked =
application_manager_.GetPolicyHandler().IsApplicationRevoked(
application->policy_app_id());
- const bool restore_hmi_level_allowed = is_resume_allowed_by_low_voltage &&
- is_hmi_level_allowed_by_ign_cycle &&
- !is_app_revoked;
+ bool restore_hmi_level_allowed = true;
+ if (!is_unexpected_disconnect_in_current_ign_cycle) {
+ const bool is_hmi_level_allowed_by_ign_cycle =
+ CheckIgnCycleRestrictions(saved_app);
+ restore_hmi_level_allowed = is_resume_allowed_by_low_voltage &&
+ is_hmi_level_allowed_by_ign_cycle &&
+ !is_app_revoked;
+ } else {
+ const bool is_resume_app_data_not_expired =
+ !IsAppDataResumptionExpired(saved_app);
+ restore_hmi_level_allowed = is_resume_allowed_by_low_voltage &&
+ is_resume_app_data_not_expired &&
+ !is_app_revoked;
+ }
if (restore_hmi_level_allowed) {
SDL_LOG_INFO("Resume application " << application->policy_app_id());