summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorypostolov <ypostolov@luxoft.com>2020-02-03 17:42:12 +0200
committerypostolov <ypostolov@luxoft.com>2020-02-03 17:42:12 +0200
commit6141f01c5dfc2fc6fabcdff5e3d40e92736c4777 (patch)
treed27eb38d25f2efcf62ab9fe697f0c032e1ab9b34
parentcf49a3ba79eea3307c3b10511eeb9c1e487a3402 (diff)
downloadsdl_core-fix/hmi_status_of_apps_not_set_properly.tar.gz
Potential fix HMI status of Apps are not set properlyfix/hmi_status_of_apps_not_set_properly
-rw-r--r--src/components/application_manager/include/application_manager/hmi_state.h9
-rw-r--r--src/components/application_manager/src/hmi_state.cc17
-rw-r--r--src/components/application_manager/src/state_controller_impl.cc12
3 files changed, 31 insertions, 7 deletions
diff --git a/src/components/application_manager/include/application_manager/hmi_state.h b/src/components/application_manager/include/application_manager/hmi_state.h
index 5b9e201391..83aa00d040 100644
--- a/src/components/application_manager/include/application_manager/hmi_state.h
+++ b/src/components/application_manager/include/application_manager/hmi_state.h
@@ -256,6 +256,15 @@ class HmiState {
*/
bool is_mobile_projection_app() const;
+ /**
+ * @brief is_video_streaming_app checks if application of 'projection' or
+ * 'navigation'
+ * HMI type
+ * @return True if application is of 'projection' or 'navigation' HMI type,
+ * otherwise - false
+ */
+ bool is_video_streaming_app() const;
+
private:
void operator=(const HmiState&);
};
diff --git a/src/components/application_manager/src/hmi_state.cc b/src/components/application_manager/src/hmi_state.cc
index 844d0254cf..a5a173d713 100644
--- a/src/components/application_manager/src/hmi_state.cc
+++ b/src/components/application_manager/src/hmi_state.cc
@@ -98,6 +98,10 @@ bool HmiState::is_mobile_projection_app() const {
return app ? app->mobile_projection_enabled() : false;
}
+bool HmiState::is_video_streaming_app() const {
+ return is_navi_app() || is_mobile_projection_app();
+}
+
mobile_apis::WindowType::eType HmiState::window_type() const {
return window_type_;
}
@@ -142,9 +146,13 @@ VideoStreamingHmiState::VideoStreamingHmiState(
mobile_apis::VideoStreamingState::eType
VideoStreamingHmiState::video_streaming_state() const {
+ using namespace helpers;
+ using namespace mobile_apis;
const ApplicationSharedPtr app =
app_mngr_.application_by_hmi_app(hmi_app_id_);
- if (app && app->IsVideoApplication()) {
+ if (app && app->IsVideoApplication() &&
+ (Compare<HMILevel::eType, EQ, ONE>(
+ hmi_level(), HMILevel::HMI_FULL, HMILevel::HMI_LIMITED))) {
return parent()->video_streaming_state();
}
@@ -240,6 +248,7 @@ AudioSource::AudioSource(std::shared_ptr<Application> app,
mobile_apis::HMILevel::eType AudioSource::hmi_level() const {
using namespace mobile_apis;
+ using namespace helpers;
if (WindowType::WIDGET == window_type()) {
return parent()->hmi_level();
@@ -247,7 +256,11 @@ mobile_apis::HMILevel::eType AudioSource::hmi_level() const {
// Checking for NONE is necessary to avoid issue during
// calculation of HMI level during setting default HMI level
- if (keep_context_ || HMILevel::HMI_NONE == parent()->hmi_level()) {
+
+ if (keep_context_ || !is_media_app() ||
+ Compare<HMILevel::eType, EQ, ONE>(parent()->hmi_level(),
+ HMILevel::HMI_BACKGROUND,
+ HMILevel::HMI_NONE)) {
return parent()->hmi_level();
}
diff --git a/src/components/application_manager/src/state_controller_impl.cc b/src/components/application_manager/src/state_controller_impl.cc
index 1bf4c2bf66..91b54520e0 100644
--- a/src/components/application_manager/src/state_controller_impl.cc
+++ b/src/components/application_manager/src/state_controller_impl.cc
@@ -386,12 +386,14 @@ void StateControllerImpl::HmiLevelConflictResolver::operator()(
mobile_apis::AudioStreamingState::eType result_audio_state =
mobile_apis::AudioStreamingState::NOT_AUDIBLE;
- if (to_resolve_grabs_audio && !same_app_audio_type) {
- result_audio_state = mobile_apis::AudioStreamingState::AUDIBLE;
- }
+ if (!same_app_audio_type) {
+ if (to_resolve_grabs_audio) {
+ result_audio_state = mobile_apis::AudioStreamingState::AUDIBLE;
+ }
- if (to_resolve_grabs_video && !applied_grabs_video) {
- result_video_state = mobile_apis::VideoStreamingState::STREAMABLE;
+ if (to_resolve_grabs_video && !applied_grabs_video) {
+ result_video_state = mobile_apis::VideoStreamingState::STREAMABLE;
+ }
}
mobile_apis::HMILevel::eType result_hmi_level = state_to_resolve->hmi_level();