summaryrefslogtreecommitdiff
path: root/src/components/application_manager/src/rpc_handler_impl.cc
diff options
context:
space:
mode:
authorAndrii Kalinich (GitHub) <AKalinich@luxoft.com>2019-09-24 13:44:53 -0400
committerCollin <iCollin@users.noreply.github.com>2019-09-24 13:44:53 -0400
commitb454f5cbbe69741eaa266761787006c81a2c6da7 (patch)
treef166a160ee41a1282bfa3facc9db86cb28fd02ac /src/components/application_manager/src/rpc_handler_impl.cc
parenta302262312f11d3b1b12011623c16107b200489a (diff)
downloadsdl_core-b454f5cbbe69741eaa266761787006c81a2c6da7.tar.gz
Fix SDL behavior during LOW_VOLTAGE (#3029)
There were found a several problems during SDL testing with ATF scripts: 1. SDL does not ignore messages from mobile/HMI during low voltage and processes them on wake up 2. Sometimes SDL ignores messages on wake up due to timings 3. SDL low voltage process is not stopping properly by exit() function 4. SDL does not send OnAppUnregistered after wake up to HMI To solve mentioned problems, the following changes were done: 1. exit() was replaced with _Exit() which allow to force close the process 2. Suspend transport events processing threads during low voltage, such as unexpected disconnect etc. These events should be processed when SDL wakes up completely. 3. Suspend all client listening threads and shut down sockets for a TCP connections to prevent any possibility to receive message during low voltage. These threads will be resumed on wake up. 4. Set low_voltage flag to false in the end of wakeup() function to prevent any timing issues. 5. Don't add pending requests/notifications into request controller if low voltage event has happened, as it may happen at any moment 6. Don't handle received pending messages from mobile/HMI in RPC handler if low voltage event has happened as it may happen at any moment 7. Updated logic of few test case scenarios. Updated unit tests according to code changes
Diffstat (limited to 'src/components/application_manager/src/rpc_handler_impl.cc')
-rw-r--r--src/components/application_manager/src/rpc_handler_impl.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/components/application_manager/src/rpc_handler_impl.cc b/src/components/application_manager/src/rpc_handler_impl.cc
index d1ca05e9a1..695d94628d 100644
--- a/src/components/application_manager/src/rpc_handler_impl.cc
+++ b/src/components/application_manager/src/rpc_handler_impl.cc
@@ -208,6 +208,10 @@ void RPCHandlerImpl::Handle(const impl::MessageFromMobile message) {
LOG4CXX_INFO(logger_, "Application manager is stopping");
return;
}
+ if (app_manager_.IsLowVoltage()) {
+ LOG4CXX_ERROR(logger_, "Low Voltage is active.");
+ return;
+ }
ProcessMessageFromMobile(message);
}
@@ -219,6 +223,11 @@ void RPCHandlerImpl::Handle(const impl::MessageFromHmi message) {
LOG4CXX_ERROR(logger_, "Null-pointer message received.");
return;
}
+ if (app_manager_.IsLowVoltage()) {
+ LOG4CXX_ERROR(logger_, "Low Voltage is active.");
+ return;
+ }
+
ProcessMessageFromHMI(message);
}
@@ -226,6 +235,11 @@ void RPCHandlerImpl::OnMessageReceived(
const protocol_handler::RawMessagePtr message) {
LOG4CXX_AUTO_TRACE(logger_);
+ if (app_manager_.IsLowVoltage()) {
+ LOG4CXX_ERROR(logger_, "Low Voltage is active.");
+ return;
+ }
+
if (!message) {
LOG4CXX_ERROR(logger_, "Null-pointer message received.");
NOTREACHED();