summaryrefslogtreecommitdiff
path: root/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/application_manager/src/commands/mobile/register_app_interface_request.cc')
-rw-r--r--src/components/application_manager/src/commands/mobile/register_app_interface_request.cc20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc b/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc
index ac6971ac3..36b2c27f7 100644
--- a/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc
+++ b/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc
@@ -157,12 +157,26 @@ void RegisterAppInterfaceRequest::Run() {
// FIXME(EZamakhov): on shutdown - get freez
// wait till HMI started
- while (!ApplicationManagerImpl::instance()->IsHMICooperating()) {
- sleep(1);
- // TODO(DK): timer_->StartWait(1);
+ while (ApplicationManagerImpl::exists() &&
+ !ApplicationManagerImpl::instance()->IsStopping() &&
+ !ApplicationManagerImpl::instance()->IsHMICooperating()) {
+ LOG4CXX_DEBUG(logger_, "Waiting for the HMI... conn_key="
+ << connection_key() << ", correlation_id=" << correlation_id()
+ << ", default_timeout=" << default_timeout()
+ << ", thread=" << pthread_self());
ApplicationManagerImpl::instance()->updateRequestTimeout(connection_key(),
correlation_id(),
default_timeout());
+ sleep(1);
+ // TODO(DK): timer_->StartWait(1);
+ }
+
+ if (!ApplicationManagerImpl::exists()) {
+ LOG4CXX_WARN(logger_, "The ApplicationManager doesn't exist!");
+ return;
+ } else if (ApplicationManagerImpl::instance()->IsStopping()) {
+ LOG4CXX_WARN(logger_, "The ApplicationManager is stopping!");
+ return;
}
const std::string mobile_app_id = (*message_)[strings::msg_params][strings::app_id]