summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndriy Byzhynar (GitHub) <AByzhynar@luxoft.com>2016-10-19 11:25:20 +0300
committerGitHub <noreply@github.com>2016-10-19 11:25:20 +0300
commit5550953cfa31650e23c2358c90f2c7584094c269 (patch)
treef3a388171af50d039d02bf5f68c89eae65ecf70b
parent43748424f178e3fc636703bcc4061fb3a5b5668a (diff)
parent77439a15f2982391a49f10650a9f0082cf1b7d6c (diff)
downloadsdl_core-5550953cfa31650e23c2358c90f2c7584094c269.tar.gz
Merge pull request #904 from LevchenkoS/fix/Fix_that_start_stream_request_may_hang_forever_in_case_of_app_absence
Fix that StartStreamRequest may hang forever in case of app absence
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_audio_start_stream_request.cc15
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_start_stream_request.cc16
2 files changed, 14 insertions, 17 deletions
diff --git a/src/components/application_manager/src/commands/hmi/navi_audio_start_stream_request.cc b/src/components/application_manager/src/commands/hmi/navi_audio_start_stream_request.cc
index db7477aae2..1e46eab52e 100644
--- a/src/components/application_manager/src/commands/hmi/navi_audio_start_stream_request.cc
+++ b/src/components/application_manager/src/commands/hmi/navi_audio_start_stream_request.cc
@@ -63,20 +63,19 @@ void AudioStartStreamRequest::Run() {
LOG4CXX_INFO(logger_, "Interface Navi is not supported by system");
return;
}
- SetAllowedToTerminate(false);
- subscribe_on_event(hmi_apis::FunctionID::Navigation_StartAudioStream,
- correlation_id());
-
ApplicationSharedPtr app =
application_manager_.application_by_hmi_app(application_id());
- if (app) {
- app->set_audio_streaming_allowed(true);
- SendRequest();
- } else {
+ if (!app) {
LOG4CXX_ERROR(logger_,
"Applcation with hmi_app_id " << application_id()
<< " does not exist");
+ return;
}
+ SetAllowedToTerminate(false);
+ subscribe_on_event(hmi_apis::FunctionID::Navigation_StartAudioStream,
+ correlation_id());
+ app->set_audio_streaming_allowed(true);
+ SendRequest();
}
void AudioStartStreamRequest::on_event(const event_engine::Event& event) {
diff --git a/src/components/application_manager/src/commands/hmi/navi_start_stream_request.cc b/src/components/application_manager/src/commands/hmi/navi_start_stream_request.cc
index 38a38e9329..9f1c4b7902 100644
--- a/src/components/application_manager/src/commands/hmi/navi_start_stream_request.cc
+++ b/src/components/application_manager/src/commands/hmi/navi_start_stream_request.cc
@@ -63,21 +63,19 @@ void NaviStartStreamRequest::Run() {
LOG4CXX_INFO(logger_, "Interface Navi is not supported by system");
return;
}
-
- SetAllowedToTerminate(false);
- subscribe_on_event(hmi_apis::FunctionID::Navigation_StartStream,
- correlation_id());
-
ApplicationSharedPtr app =
application_manager_.application_by_hmi_app(application_id());
- if (app) {
- app->set_video_streaming_allowed(true);
- SendRequest();
- } else {
+ if (!app) {
LOG4CXX_ERROR(logger_,
"Applcation with hmi_app_id " << application_id()
<< "does not exist");
+ return;
}
+ SetAllowedToTerminate(false);
+ subscribe_on_event(hmi_apis::FunctionID::Navigation_StartStream,
+ correlation_id());
+ app->set_video_streaming_allowed(true);
+ SendRequest();
}
void NaviStartStreamRequest::on_event(const event_engine::Event& event) {