diff options
Diffstat (limited to 'src/components/application_manager/src')
3 files changed, 66 insertions, 39 deletions
diff --git a/src/components/application_manager/src/application_impl.cc b/src/components/application_manager/src/application_impl.cc index c595f8ecf9..27c7411d15 100644 --- a/src/components/application_manager/src/application_impl.cc +++ b/src/components/application_manager/src/application_impl.cc @@ -106,6 +106,7 @@ ApplicationImpl::ApplicationImpl( , is_navi_(false) , is_remote_control_supported_(false) , mobile_projection_enabled_(false) + , webengine_projection_enabled_(false) , video_streaming_approved_(false) , audio_streaming_approved_(false) , video_streaming_allowed_(false) @@ -199,33 +200,39 @@ bool ApplicationImpl::is_audio() const { } void ApplicationImpl::ChangeSupportingAppHMIType() { - is_navi_ = false; - is_voice_communication_application_ = false; - mobile_projection_enabled_ = false; + set_is_navi(false); + set_voice_communication_supported(false); + set_mobile_projection_enabled(false); + set_webengine_projection_enabled(false); const smart_objects::SmartObject& array_app_types = *app_types_; uint32_t lenght_app_types = array_app_types.length(); for (uint32_t i = 0; i < lenght_app_types; ++i) { - if (mobile_apis::AppHMIType::NAVIGATION == - static_cast<mobile_apis::AppHMIType::eType>( - array_app_types[i].asUInt())) { - is_navi_ = true; - } - if (mobile_apis::AppHMIType::COMMUNICATION == - static_cast<mobile_apis::AppHMIType::eType>( - array_app_types[i].asUInt())) { - is_voice_communication_application_ = true; - } - if (mobile_apis::AppHMIType::PROJECTION == - static_cast<mobile_apis::AppHMIType::eType>( - array_app_types[i].asUInt())) { - mobile_projection_enabled_ = true; + const auto app_hmi_type = static_cast<mobile_apis::AppHMIType::eType>( + array_app_types[i].asUInt()); + + switch (app_hmi_type) { + case mobile_apis::AppHMIType::NAVIGATION: + set_is_navi(true); + break; + case mobile_apis::AppHMIType::COMMUNICATION: + set_voice_communication_supported(true); + break; + case mobile_apis::AppHMIType::PROJECTION: + set_mobile_projection_enabled(true); + break; + case mobile_apis::AppHMIType::WEB_VIEW: + set_webengine_projection_enabled(true); + break; + default: + break; } } } -void ApplicationImpl::set_is_navi(bool allow) { - is_navi_ = allow; +void ApplicationImpl::set_is_navi(bool option) { + LOG4CXX_TRACE(logger_, "option " << std::boolalpha << option); + is_navi_ = option; } bool ApplicationImpl::is_remote_control_supported() const { @@ -240,9 +247,9 @@ bool ApplicationImpl::is_voice_communication_supported() const { return is_voice_communication_application_; } -void ApplicationImpl::set_voice_communication_supported( - bool is_voice_communication_supported) { - is_voice_communication_application_ = is_voice_communication_supported; +void ApplicationImpl::set_voice_communication_supported(bool option) { + LOG4CXX_TRACE(logger_, "option " << std::boolalpha << option); + is_voice_communication_application_ = option; } bool ApplicationImpl::IsAudioApplication() const { @@ -286,7 +293,7 @@ void ApplicationImpl::SetPostponedState(const WindowID window_id, } void ApplicationImpl::set_mobile_projection_enabled(bool option) { - LOG4CXX_AUTO_TRACE(logger_); + LOG4CXX_TRACE(logger_, "option " << std::boolalpha << option); mobile_projection_enabled_ = option; } @@ -294,6 +301,15 @@ bool ApplicationImpl::mobile_projection_enabled() const { return mobile_projection_enabled_; } +void ApplicationImpl::set_webengine_projection_enabled(const bool option) { + LOG4CXX_TRACE(logger_, "option " << std::boolalpha << option); + webengine_projection_enabled_ = option; +} + +bool ApplicationImpl::webengine_projection_enabled() const { + return webengine_projection_enabled_; +} + struct StateIDComparator { HmiState::StateID state_id_; StateIDComparator(HmiState::StateID state_id) : state_id_(state_id) {} @@ -457,8 +473,9 @@ void ApplicationImpl::set_name(const custom_str::CustomString& name) { app_name_ = name; } -void ApplicationImpl::set_is_media_application(bool is_media) { - is_media_ = is_media; +void ApplicationImpl::set_is_media_application(bool option) { + LOG4CXX_TRACE(logger_, "option " << std::boolalpha << option); + is_media_ = option; } bool IsTTSState(const HmiStatePtr state) { diff --git a/src/components/application_manager/src/commands/command_notification_impl.cc b/src/components/application_manager/src/commands/command_notification_impl.cc index cc2606ab6f..31bea114ec 100644 --- a/src/components/application_manager/src/commands/command_notification_impl.cc +++ b/src/components/application_manager/src/commands/command_notification_impl.cc @@ -63,16 +63,18 @@ bool CommandNotificationImpl::CleanUp() { void CommandNotificationImpl::Run() {} -void CommandNotificationImpl::SendNotification() { +void CommandNotificationImpl::SendNotification(const bool final_message) { (*message_)[strings::params][strings::protocol_type] = mobile_protocol_type_; (*message_)[strings::params][strings::protocol_version] = protocol_version_; (*message_)[strings::params][strings::message_type] = static_cast<int32_t>(application_manager::MessageType::kNotification); - LOG4CXX_INFO(logger_, "SendNotification"); + LOG4CXX_INFO( + logger_, + "SendNotification: final_message = " << std::boolalpha << final_message); MessageHelper::PrintSmartObject(*message_); - rpc_service_.SendMessageToMobile(message_); + rpc_service_.SendMessageToMobile(message_, final_message); } } // namespace commands diff --git a/src/components/application_manager/src/state_controller_impl.cc b/src/components/application_manager/src/state_controller_impl.cc index b07a5bcc13..ffff294664 100644 --- a/src/components/application_manager/src/state_controller_impl.cc +++ b/src/components/application_manager/src/state_controller_impl.cc @@ -88,7 +88,10 @@ void StateControllerImpl::SetRegularState(ApplicationSharedPtr app, return; } - if (app->is_resuming() && !IsResumptionAllowed(app, state)) { + const bool app_is_resuming = app->is_resuming(); + const bool is_resumption_allowed = IsResumptionAllowed(app, state); + + if (app_is_resuming && !is_resumption_allowed) { return; } @@ -333,15 +336,15 @@ void StateControllerImpl::HmiLevelConflictResolver::operator()( DCHECK_OR_RETURN_VOID(state_to_resolve); // If applied HMI state is FULL: - // - all NOT audio/video applications becomes BACKGROUND + // - all NOT audio/video applications become BACKGROUND // - all audio/video applications with other app type - // (navi, vc, media, projection) in FULL becomes LIMMITED - // - all audio/video applications with same app type becomes BACKGROUND + // (navi, vc, media, projection) in FULL become LIMITED + // - all audio/video applications with the same app type become BACKGROUND // // If applied HMI state is LIMITED: - // - all NOT audio/video applications saves their's HMI states - // - all applications with other app types saves their's HMI states - // - all audio/video applications with same app type becomes BACKGROUND + // - all NOT audio/video applications saves their HMI states + // - all applications with the other app types saves their HMI states + // - all audio/video applications with the same app type become BACKGROUND if (!IsStreamableHMILevel(state_->hmi_level())) { LOG4CXX_DEBUG(logger_, @@ -478,10 +481,14 @@ bool StateControllerImpl::IsResumptionAllowed(ApplicationSharedPtr app, return false; } + const bool is_navi_app = app->is_navi(); + const bool is_mob_projection_app = app->mobile_projection_enabled(); + const bool is_wep_app = app->webengine_projection_enabled(); + if (IsTempStateActive(HmiState::StateID::STATE_ID_EMBEDDED_NAVI) && - (app->is_navi() || app->mobile_projection_enabled())) { + (is_navi_app || is_mob_projection_app || is_wep_app)) { LOG4CXX_DEBUG(logger_, - "Resumption for navi or projection app is not allowed. " + "Resumption for navi and projection apps is not allowed. " << "EMBEDDED_NAVI event is active"); return false; } @@ -895,7 +902,7 @@ void StateControllerImpl::OnApplicationRegistered( const mobile_apis::HMILevel::eType default_level) { LOG4CXX_AUTO_TRACE(logger_); - // After app registration HMI level should be set for DEFAUL_WINDOW only + // After app registration HMI level should be set for DEFAULT_WINDOW only OnAppWindowAdded(app, mobile_apis::PredefinedWindows::DEFAULT_WINDOW, mobile_apis::WindowType::MAIN, @@ -1268,7 +1275,8 @@ mobile_apis::VideoStreamingState::eType StateControllerImpl::CalcVideoState( ApplicationSharedPtr app, const mobile_apis::HMILevel::eType hmi_level) const { auto state = mobile_apis::VideoStreamingState::NOT_STREAMABLE; - if (IsStreamableHMILevel(hmi_level) && app->IsVideoApplication()) { + + if (app->IsVideoApplication() && IsStreamableHMILevel(hmi_level)) { state = mobile_apis::VideoStreamingState::STREAMABLE; } |