summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrii Kalinich (GitHub) <AKalinich@luxoft.com>2019-10-23 12:39:26 -0700
committerCollin <iCollin@users.noreply.github.com>2019-10-23 15:39:26 -0400
commit494a8a4a4bdac82f47f87d521bc4ed37aeb57c17 (patch)
treeced0207776f1a2384743c0bab3f4eb7116699599
parent59157f0e79566a5dfcd860bbb220f76843ff519b (diff)
downloadsdl_core-494a8a4a4bdac82f47f87d521bc4ed37aeb57c17.tar.gz
Fix sending of OnServiceUpdate on service NACK (#3095)
There was found one corner case when SDL does not change the internal status when service start was refused due to current HMI level of application. Was added missing check to set status properly and send expected notification.
-rw-r--r--src/components/protocol_handler/src/protocol_handler_impl.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/components/protocol_handler/src/protocol_handler_impl.cc b/src/components/protocol_handler/src/protocol_handler_impl.cc
index 61b9afd7bc..3b216c273c 100644
--- a/src/components/protocol_handler/src/protocol_handler_impl.cc
+++ b/src/components/protocol_handler/src/protocol_handler_impl.cc
@@ -1816,8 +1816,15 @@ void ProtocolHandlerImpl::NotifySessionStarted(
LOG4CXX_WARN(logger_,
"Refused by session_observer to create service "
<< static_cast<int32_t>(service_type) << " type.");
+ const auto session_id = packet->session_id();
+ const auto connection_key =
+ session_observer_.KeyFromPair(context.connection_id_, session_id);
+ service_status_update_handler_->OnServiceUpdate(
+ connection_key,
+ context.service_type_,
+ ServiceStatus::SERVICE_START_FAILED);
SendStartSessionNAck(context.connection_id_,
- packet->session_id(),
+ session_id,
protocol_version,
packet->service_type(),
rejected_params);