diff options
8 files changed, 39 insertions, 39 deletions
diff --git a/src/components/application_manager/include/application_manager/application.h b/src/components/application_manager/include/application_manager/application.h index d18ca599fb..2c57961932 100644 --- a/src/components/application_manager/include/application_manager/application.h +++ b/src/components/application_manager/include/application_manager/application.h @@ -406,10 +406,10 @@ class Application : public virtual InitialApplicationData, virtual bool is_navi() const = 0; virtual void set_is_navi(bool allow) = 0; - virtual bool video_streaming_started() const = 0; - virtual void set_video_streaming_started(bool state) = 0; - virtual bool audio_streaming_started() const = 0; - virtual void set_audio_streaming_started(bool state) = 0; + virtual bool video_streaming_approved() const = 0; + virtual void set_video_streaming_approved(bool state) = 0; + virtual bool audio_streaming_approved() const = 0; + virtual void set_audio_streaming_approved(bool state) = 0; virtual bool video_streaming_allowed() const = 0; virtual void set_video_streaming_allowed(bool state) = 0; diff --git a/src/components/application_manager/include/application_manager/application_impl.h b/src/components/application_manager/include/application_manager/application_impl.h index 974cd2a155..3d060933fc 100644 --- a/src/components/application_manager/include/application_manager/application_impl.h +++ b/src/components/application_manager/include/application_manager/application_impl.h @@ -87,10 +87,10 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl, inline bool is_navi() const { return is_navi_; } void set_is_navi(bool allow); - bool video_streaming_started() const; - void set_video_streaming_started(bool state); - bool audio_streaming_started() const; - void set_audio_streaming_started(bool state); + bool video_streaming_approved() const; + void set_video_streaming_approved(bool state); + bool audio_streaming_approved() const; + void set_audio_streaming_approved(bool state); bool video_streaming_allowed() const; void set_video_streaming_allowed(bool state); @@ -289,8 +289,8 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl, bool is_media_; bool is_navi_; - bool video_streaming_started_; - bool audio_streaming_started_; + bool video_streaming_approved_; + bool audio_streaming_approved_; bool video_streaming_allowed_; bool audio_streaming_allowed_; bool video_streaming_suspended_; diff --git a/src/components/application_manager/include/application_manager/application_manager_impl.h b/src/components/application_manager/include/application_manager/application_manager_impl.h index 6bcac4abc3..af7c08f357 100644 --- a/src/components/application_manager/include/application_manager/application_manager_impl.h +++ b/src/components/application_manager/include/application_manager/application_manager_impl.h @@ -662,7 +662,7 @@ class ApplicationManagerImpl : public ApplicationManager, * @param service_type Service type to check * @return True if streaming is allowed, false in other case */ - bool IsStreamingAllowed( + bool HMILevelAllowsStreaming( uint32_t app_id, protocol_handler::ServiceType service_type) const; /** diff --git a/src/components/application_manager/src/application_impl.cc b/src/components/application_manager/src/application_impl.cc index cb4076a394..d98044b2f3 100644 --- a/src/components/application_manager/src/application_impl.cc +++ b/src/components/application_manager/src/application_impl.cc @@ -86,8 +86,8 @@ ApplicationImpl::ApplicationImpl(uint32_t application_id, active_message_(NULL), is_media_(false), is_navi_(false), - video_streaming_started_(false), - audio_streaming_started_(false), + video_streaming_approved_(false), + audio_streaming_approved_(false), video_streaming_allowed_(false), audio_streaming_allowed_(false), video_streaming_suspended_(true), @@ -389,34 +389,34 @@ bool ApplicationImpl::tts_properties_in_full() { return tts_properties_in_full_; } -void ApplicationImpl::set_video_streaming_started(bool state) { +void ApplicationImpl::set_video_streaming_approved(bool state) { if (state) { if (video_stream_retry_timer_->isRunning()) { video_stream_retry_timer_->stop(); - video_streaming_started_ = state; + video_streaming_approved_ = state; } } else { - video_streaming_started_ = state; + video_streaming_approved_ = state; } } -bool ApplicationImpl::video_streaming_started() const { - return video_streaming_started_; +bool ApplicationImpl::video_streaming_approved() const { + return video_streaming_approved_; } -void ApplicationImpl::set_audio_streaming_started(bool state) { +void ApplicationImpl::set_audio_streaming_approved(bool state) { if (state) { if (audio_stream_retry_timer_->isRunning()) { audio_stream_retry_timer_->stop(); - audio_streaming_started_ = state; + audio_streaming_approved_ = state; } } else { - audio_streaming_started_ = state; + audio_streaming_approved_ = state; } } -bool ApplicationImpl::audio_streaming_started() const { - return audio_streaming_started_; +bool ApplicationImpl::audio_streaming_approved() const { + return audio_streaming_approved_; } void ApplicationImpl::set_video_streaming_allowed(bool state) { @@ -444,13 +444,13 @@ void ApplicationImpl::StartStreaming( profile::Profile::instance()->start_stream_retry_amount(); if (ServiceType::kMobileNav == service_type) { - if (!video_streaming_started()) { + if (!video_streaming_approved()) { MessageHelper::SendNaviStartStream(app_id()); video_stream_retry_number_ = stream_retry.first; video_stream_retry_timer_->start(stream_retry.second); } } else if (ServiceType::kAudio == service_type) { - if (!audio_streaming_started()) { + if (!audio_streaming_approved()) { MessageHelper::SendAudioStartStream(app_id()); audio_stream_retry_number_ = stream_retry.first; audio_stream_retry_timer_->start(stream_retry.second); @@ -465,17 +465,17 @@ void ApplicationImpl::StopStreaming( if (ServiceType::kMobileNav == service_type) { video_stream_retry_timer_->stop(); - if (video_streaming_started()) { + if (video_streaming_approved()) { video_stream_suspend_timer_->stop(); MessageHelper::SendNaviStopStream(app_id()); - set_video_streaming_started(false); + set_video_streaming_approved(false); } } else if (ServiceType::kAudio == service_type) { audio_stream_retry_timer_->stop(); - if (audio_streaming_started()) { + if (audio_streaming_approved()) { audio_stream_suspend_timer_->stop(); MessageHelper::SendAudioStopStream(app_id()); - set_audio_streaming_started(false); + set_audio_streaming_approved(false); } } } diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index 2597d0eb39..3a5b088fb3 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -978,7 +978,7 @@ bool ApplicationManagerImpl::StartNaviService( return false; } - if (IsStreamingAllowed(app_id, service_type)) { + if (HMILevelAllowsStreaming(app_id, service_type)) { NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id); if (navi_service_status_.end() == it) { @@ -2480,7 +2480,7 @@ bool ApplicationManagerImpl::IsLowVoltage() { return is_low_voltage_; } -bool ApplicationManagerImpl::IsStreamingAllowed( +bool ApplicationManagerImpl::HMILevelAllowsStreaming( uint32_t app_id, protocol_handler::ServiceType service_type) const { LOG4CXX_AUTO_TRACE(logger_); using namespace mobile_apis::HMILevel; @@ -2514,7 +2514,7 @@ bool ApplicationManagerImpl::CanAppStream( } else { LOG4CXX_WARN(logger_, "Unsupported service_type " << service_type); } - return IsStreamingAllowed(app_id, service_type) && is_allowed; + return HMILevelAllowsStreaming(app_id, service_type) && is_allowed; } void ApplicationManagerImpl::ForbidStreaming(uint32_t app_id) { @@ -2579,13 +2579,13 @@ void ApplicationManagerImpl::EndNaviServices(uint32_t app_id) { if (it->second.first) { LOG4CXX_DEBUG(logger_, "Going to end video service"); connection_handler_->SendEndService(app_id, ServiceType::kMobileNav); - app->set_video_streaming_started(false); + app->set_video_streaming_approved(false); app->set_video_streaming_allowed(false); } if (it->second.second) { LOG4CXX_DEBUG(logger_, "Going to end audio service"); connection_handler_->SendEndService(app_id, ServiceType::kAudio); - app->set_audio_streaming_started(false); + app->set_audio_streaming_approved(false); app->set_audio_streaming_allowed(false); } navi_app_to_stop_.push_back(app_id); 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 86118f9fd4..1fdca390f3 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 @@ -88,8 +88,8 @@ void AudioStartStreamRequest::on_event(const event_engine::Event& event) { if (hmi_apis::Common_Result::SUCCESS == code) { LOG4CXX_DEBUG(logger_, "StartAudioStreamResponse SUCCESS"); - if (app_mgr->IsStreamingAllowed(app->app_id(), ServiceType::kAudio)) { - app->set_audio_streaming_started(true); + if (app_mgr->HMILevelAllowsStreaming(app->app_id(), ServiceType::kAudio)) { + app->set_audio_streaming_approved(true); } else { LOG4CXX_DEBUG(logger_, "StartAudioStreamRequest aborted. Application can not stream"); 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 d5b9499f25..f721aebb42 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 @@ -89,8 +89,8 @@ void NaviStartStreamRequest::on_event(const event_engine::Event& event) { if (hmi_apis::Common_Result::SUCCESS == code) { LOG4CXX_DEBUG(logger_, "NaviStartStreamResponse SUCCESS"); - if (app_mgr->IsStreamingAllowed(app->app_id(), ServiceType::kMobileNav)) { - app->set_video_streaming_started(true); + if (app_mgr->HMILevelAllowsStreaming(app->app_id(), ServiceType::kMobileNav)) { + app->set_video_streaming_approved(true); } else { LOG4CXX_DEBUG(logger_, "NaviStartStreamRequest aborted. Application can not stream"); diff --git a/src/components/application_manager/test/mock/include/application_manager/application_manager_impl.h b/src/components/application_manager/test/mock/include/application_manager/application_manager_impl.h index 8ef18a4d09..13ac08156f 100644 --- a/src/components/application_manager/test/mock/include/application_manager/application_manager_impl.h +++ b/src/components/application_manager/test/mock/include/application_manager/application_manager_impl.h @@ -246,7 +246,7 @@ class ApplicationManagerImpl : public ApplicationManager, MOCK_METHOD0(resume_controller, ResumeCtrl&()); MOCK_METHOD1(GetDefaultHmiLevel, mobile_api::HMILevel::eType (ApplicationSharedPtr)); - MOCK_METHOD2(IsStreamingAllowed, bool(uint32_t, protocol_handler::ServiceType)); + MOCK_METHOD2(HMILevelAllowsStreaming, bool(uint32_t, protocol_handler::ServiceType)); MOCK_METHOD2(CanAppStream, bool(uint32_t, protocol_handler::ServiceType)); MOCK_METHOD1(EndNaviServices, void(int32_t)); MOCK_METHOD1(ForbidStreaming, void(int32_t)); |