summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander <akutsan@luxoft.com>2018-09-07 18:08:59 +0300
committerAndriy Byzhynar <abyzhynar@luxoft.com>2018-09-17 16:53:29 +0300
commit4b80f932ffea8b0149214ca8aa9f77765428b21f (patch)
tree8fa9d9cf7fd823c636a17831bb7efd3356c0c5ab
parentb9e1b71ae3125e2536751eaa688e43dc1c8d0f9c (diff)
downloadsdl_core-4b80f932ffea8b0149214ca8aa9f77765428b21f.tar.gz
Reset global properties only in case they were successfuly sent
-rw-r--r--src/components/application_manager/src/resumption/resumption_data_processor.cc17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/components/application_manager/src/resumption/resumption_data_processor.cc b/src/components/application_manager/src/resumption/resumption_data_processor.cc
index 2d8406a3f5..7a882660b2 100644
--- a/src/components/application_manager/src/resumption/resumption_data_processor.cc
+++ b/src/components/application_manager/src/resumption/resumption_data_processor.cc
@@ -479,8 +479,18 @@ void ResumptionDataProcessor::DeleteGlobalProperties(
const uint32_t app_id = application->app_id();
const auto result =
application_manager_.ResetAllApplicationGlobalProperties(app_id);
-
- if (result.HasUIPropertiesReset()) {
+ ApplicationResumptionStatus& status = resumption_status_[app_id];
+ auto check_if_successful = [status](hmi_apis::FunctionID::eType function_id) {
+ for(auto& resumption_request : status.successful_requests) {
+ auto request_func = resumption_request.message[strings::params][strings::function_id].asInt();
+ if (request_func == function_id) {
+ return true;
+ }
+ }
+ return false;
+ };
+
+ if (result.HasUIPropertiesReset() && check_if_successful(hmi_apis::FunctionID::UI_SetGlobalProperties)) {
smart_objects::SmartObjectSPtr msg_params =
MessageHelper::CreateUIResetGlobalPropertiesRequest(result,
application);
@@ -492,7 +502,8 @@ void ResumptionDataProcessor::DeleteGlobalProperties(
(*msg)[strings::msg_params] = *msg_params;
ProcessHMIRequest(msg, false);
}
- if (result.HasTTSPropertiesReset()) {
+
+ if (result.HasTTSPropertiesReset() && check_if_successful(hmi_apis::FunctionID::TTS_SetGlobalProperties)) {
smart_objects::SmartObjectSPtr msg_params =
MessageHelper::CreateTTSResetGlobalPropertiesRequest(result,
application);