summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJackLivio <jack@livio.io>2017-07-27 10:33:29 -0400
committerJackLivio <jack@livio.io>2017-07-27 10:33:29 -0400
commit1713cb8ee875b08a6547735f453a6c3428d4a91e (patch)
treeb04eaa327a016a4a1dd0073262b12f451d3b172b
parent2cf2b12f6bd60215eb9ebfcfc15e13beabc864e3 (diff)
downloadsdl_core-1713cb8ee875b08a6547735f453a6c3428d4a91e.tar.gz
Mobile Projection Implementation and Unit Tests
-rw-r--r--src/components/application_manager/include/application_manager/application.h3
-rw-r--r--src/components/application_manager/include/application_manager/application_impl.h5
-rw-r--r--src/components/application_manager/include/application_manager/application_manager_impl.h2
-rw-r--r--src/components/application_manager/include/application_manager/hmi_state.h2
-rw-r--r--src/components/application_manager/src/application_impl.cc18
-rw-r--r--src/components/application_manager/src/application_manager_impl.cc47
-rw-r--r--src/components/application_manager/src/commands/mobile/on_touch_event_notification.cc21
-rw-r--r--src/components/application_manager/src/commands/mobile/register_app_interface_request.cc10
-rw-r--r--src/components/application_manager/src/hmi_state.cc8
-rw-r--r--src/components/application_manager/src/state_controller_impl.cc13
-rw-r--r--src/components/application_manager/test/application_impl_test.cc27
-rw-r--r--src/components/application_manager/test/commands/mobile/on_touch_event_notification_test.cc20
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_application.h2
-rw-r--r--src/components/include/application_manager/application_manager.h3
-rw-r--r--src/components/include/test/application_manager/mock_application_manager.h4
-rw-r--r--src/components/interfaces/HMI_API.xml1
-rw-r--r--src/components/interfaces/MOBILE_API.xml1
17 files changed, 167 insertions, 20 deletions
diff --git a/src/components/application_manager/include/application_manager/application.h b/src/components/application_manager/include/application_manager/application.h
index c523f61329..a0abfb79d4 100644
--- a/src/components/application_manager/include/application_manager/application.h
+++ b/src/components/application_manager/include/application_manager/application.h
@@ -427,6 +427,9 @@ class Application : public virtual InitialApplicationData,
virtual bool is_navi() const = 0;
virtual void set_is_navi(bool allow) = 0;
+ virtual void SetMobileProjectionEnabled(bool option) = 0;
+ virtual bool MobileProjectionEnabled() const = 0;
+
virtual bool video_streaming_approved() const = 0;
virtual void set_video_streaming_approved(bool state) = 0;
virtual bool audio_streaming_approved() const = 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 ae63a2f8ae..2d2994fe7d 100644
--- a/src/components/application_manager/include/application_manager/application_impl.h
+++ b/src/components/application_manager/include/application_manager/application_impl.h
@@ -96,6 +96,10 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl,
}
void set_is_navi(bool allow);
+ void SetMobileProjectionEnabled(bool option);
+
+ bool MobileProjectionEnabled() const;
+
bool video_streaming_approved() const;
void set_video_streaming_approved(bool state);
bool audio_streaming_approved() const;
@@ -338,6 +342,7 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl,
smart_objects::SmartObject* active_message_;
bool is_media_;
bool is_navi_;
+ bool mobile_projection_enabled_;
bool video_streaming_approved_;
bool audio_streaming_approved_;
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 0e6f598a9c..596b9303f3 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
@@ -243,10 +243,12 @@ class ApplicationManagerImpl
std::vector<ApplicationSharedPtr> applications_by_button(
uint32_t button) OVERRIDE;
std::vector<ApplicationSharedPtr> applications_with_navi() OVERRIDE;
+ std::vector<ApplicationSharedPtr> applications_with_mobile_projection() OVERRIDE;
ApplicationSharedPtr get_limited_media_application() const OVERRIDE;
ApplicationSharedPtr get_limited_navi_application() const OVERRIDE;
ApplicationSharedPtr get_limited_voice_application() const OVERRIDE;
+ ApplicationSharedPtr get_limited_mobile_projection_application() const OVERRIDE;
uint32_t application_id(const int32_t correlation_id) OVERRIDE;
void set_application_id(const int32_t correlation_id,
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 799fdff67d..939b8b86d0 100644
--- a/src/components/application_manager/include/application_manager/hmi_state.h
+++ b/src/components/application_manager/include/application_manager/hmi_state.h
@@ -196,6 +196,8 @@ class HmiState {
*/
bool is_voice_communication_app(const uint32_t app_id) const;
+ bool is_mobile_projection_app(const uint32_t app_id) const;
+
private:
void operator=(const HmiState&);
};
diff --git a/src/components/application_manager/src/application_impl.cc b/src/components/application_manager/src/application_impl.cc
index 5f9c4386f5..7c5f7ed6fa 100644
--- a/src/components/application_manager/src/application_impl.cc
+++ b/src/components/application_manager/src/application_impl.cc
@@ -88,6 +88,7 @@ ApplicationImpl::ApplicationImpl(
, active_message_(NULL)
, is_media_(false)
, is_navi_(false)
+ , mobile_projection_enabled_(false)
, video_streaming_approved_(false)
, audio_streaming_approved_(false)
, video_streaming_allowed_(false)
@@ -179,6 +180,7 @@ bool ApplicationImpl::is_audio() const {
void ApplicationImpl::ChangeSupportingAppHMIType() {
is_navi_ = false;
is_voice_communication_application_ = false;
+ mobile_projection_enabled_ = false;
const smart_objects::SmartObject& array_app_types = *app_types_;
uint32_t lenght_app_types = array_app_types.length();
@@ -193,6 +195,11 @@ void ApplicationImpl::ChangeSupportingAppHMIType() {
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;
+ }
}
}
@@ -228,6 +235,15 @@ void ApplicationImpl::SetPostponedState(HmiStatePtr state) {
state_.AddState(state);
}
+void ApplicationImpl::SetMobileProjectionEnabled(bool option) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ mobile_projection_enabled_ = option;
+}
+
+bool ApplicationImpl::MobileProjectionEnabled() const {
+ return mobile_projection_enabled_;
+}
+
struct StateIDComparator {
HmiState::StateID state_id_;
StateIDComparator(HmiState::StateID state_id) : state_id_(state_id) {}
@@ -489,7 +505,7 @@ void ApplicationImpl::WakeUpStreaming(
protocol_handler::ServiceType service_type) {
using namespace protocol_handler;
LOG4CXX_AUTO_TRACE(logger_);
-
+
if (ServiceType::kMobileNav == service_type) {
sync_primitives::AutoLock lock(video_streaming_suspended_lock_);
if (video_streaming_suspended_) {
diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc
index 097abc4645..c09ddffbb5 100644
--- a/src/components/application_manager/src/application_manager_impl.cc
+++ b/src/components/application_manager/src/application_manager_impl.cc
@@ -291,6 +291,28 @@ ApplicationManagerImpl::applications_with_navi() {
DataAccessor<ApplicationSet> accessor = applications();
return FindAllApps(accessor, NaviAppPredicate);
}
+
+bool LimitedMobileProjectionPredicate( const ApplicationSharedPtr app) {
+ return app ? (app->MobileProjectionEnabled() &&
+ app->hmi_level() == mobile_api::HMILevel::HMI_LIMITED) : false;
+}
+
+ApplicationSharedPtr ApplicationManagerImpl::get_limited_mobile_projection_application()
+ const {
+ DataAccessor<ApplicationSet> accessor = applications();
+ return FindApp(accessor, LimitedMobileProjectionPredicate);
+}
+
+bool MobileProjectionPredicate(const ApplicationSharedPtr app) {
+ return app ? app->MobileProjectionEnabled() : false;
+}
+
+std::vector<ApplicationSharedPtr>
+ApplicationManagerImpl::applications_with_mobile_projection() {
+ DataAccessor<ApplicationSet> accessor = applications();
+ return FindAllApps(accessor, MobileProjectionPredicate);
+}
+
std::vector<ApplicationSharedPtr>
ApplicationManagerImpl::applications_by_button(uint32_t button) {
SubscribedToButtonPredicate finder(
@@ -353,6 +375,7 @@ bool ApplicationManagerImpl::IsAppTypeExistsInFullOrLimited(
bool voice_state = app->is_voice_communication_supported();
bool media_state = app->is_media_application();
bool navi_state = app->is_navi();
+ bool mobile_projection_state = app->MobileProjectionEnabled();
ApplicationSharedPtr active_app = active_application();
// Check app in FULL level
if (active_app.valid()) {
@@ -374,6 +397,10 @@ bool ApplicationManagerImpl::IsAppTypeExistsInFullOrLimited(
if (navi_state && active_app->is_navi()) {
return true;
}
+
+ if (mobile_projection_state && active_app->MobileProjectionEnabled()) {
+ return true;
+ }
}
// Check LIMITED apps
@@ -398,6 +425,12 @@ bool ApplicationManagerImpl::IsAppTypeExistsInFullOrLimited(
}
}
+ if (mobile_projection_state) {
+ if (get_limited_mobile_projection_application().valid() &&
+ (get_limited_mobile_projection_application()->app_id() != app->app_id()))
+ return true;
+ }
+
return false;
}
@@ -1180,7 +1213,7 @@ bool ApplicationManagerImpl::OnServiceStartedCallback(
if (Compare<ServiceType, EQ, ONE>(
type, ServiceType::kMobileNav, ServiceType::kAudio)) {
- if (app->is_navi()) {
+ if (app->is_navi() || app->MobileProjectionEnabled()) {
return StartNaviService(session_key, type);
} else {
LOG4CXX_WARN(logger_, "Refuse not navi application");
@@ -2900,7 +2933,7 @@ void ApplicationManagerImpl::ForbidStreaming(uint32_t app_id) {
LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr app = application(app_id);
- if (!app || !app->is_navi()) {
+ if (!app || (!app->is_navi() && !app->MobileProjectionEnabled())) {
LOG4CXX_DEBUG(logger_, "There is no navi application with id: " << app_id);
return;
}
@@ -2934,7 +2967,7 @@ void ApplicationManagerImpl::OnAppStreaming(
LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr app = application(app_id);
- if (!app || !app->is_navi()) {
+ if (!app || (!app->is_navi() && !app->MobileProjectionEnabled())) {
LOG4CXX_DEBUG(logger_, " There is no navi application with id: " << app_id);
return;
}
@@ -2954,7 +2987,7 @@ void ApplicationManagerImpl::EndNaviServices(uint32_t app_id) {
LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr app = application(app_id);
- if (!app || !app->is_navi()) {
+ if (!app || (!app->is_navi() && !app->MobileProjectionEnabled())) {
LOG4CXX_DEBUG(logger_, "There is no navi application with id: " << app_id);
return;
}
@@ -3005,7 +3038,7 @@ void ApplicationManagerImpl::OnHMILevelChanged(
}
ApplicationSharedPtr app = application(app_id);
- if (!app || !app->is_navi()) {
+ if (!app || (!app->is_navi() && !app->MobileProjectionEnabled())) {
LOG4CXX_ERROR(logger_, "Navi application not found");
return;
}
@@ -3128,7 +3161,7 @@ void ApplicationManagerImpl::DisallowStreaming(uint32_t app_id) {
LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr app = application(app_id);
- if (!app || !app->is_navi()) {
+ if (!app || (!app->is_navi() && !app->MobileProjectionEnabled())) {
LOG4CXX_ERROR(logger_, "Navi application not found");
return;
}
@@ -3149,7 +3182,7 @@ void ApplicationManagerImpl::AllowStreaming(uint32_t app_id) {
LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr app = application(app_id);
- if (!app || !app->is_navi()) {
+ if (!app || (!app->is_navi() && !app->MobileProjectionEnabled())) {
LOG4CXX_ERROR(logger_, "Navi application not found");
return;
}
diff --git a/src/components/application_manager/src/commands/mobile/on_touch_event_notification.cc b/src/components/application_manager/src/commands/mobile/on_touch_event_notification.cc
index c769194c95..63d513bcaf 100644
--- a/src/components/application_manager/src/commands/mobile/on_touch_event_notification.cc
+++ b/src/components/application_manager/src/commands/mobile/on_touch_event_notification.cc
@@ -53,14 +53,29 @@ void OnTouchEventNotification::Run() {
const std::vector<ApplicationSharedPtr>& applications =
application_manager_.applications_with_navi();
- std::vector<ApplicationSharedPtr>::const_iterator it = applications.begin();
- for (; applications.end() != it; ++it) {
- ApplicationSharedPtr app = *it;
+ const std::vector<ApplicationSharedPtr>& projection_applications =
+ application_manager_.applications_with_mobile_projection();
+
+ std::vector<ApplicationSharedPtr>::const_iterator nav_it = applications.begin();
+
+ for (; applications.end() != nav_it; ++nav_it) {
+ ApplicationSharedPtr app = *nav_it;
if (app->IsFullscreen()) {
(*message_)[strings::params][strings::connection_key] = app->app_id();
SendNotification();
}
}
+
+ std::vector<ApplicationSharedPtr>::const_iterator projection_it =
+ projection_applications.begin();
+
+ for (; projection_applications.end() != projection_it; ++projection_it) {
+ ApplicationSharedPtr projection_app = *projection_it;
+ if (projection_app->IsFullscreen()) {
+ (*message_)[strings::params][strings::connection_key] = projection_app->app_id();
+ SendNotification();
+ }
+ }
}
} // namespace mobile
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 413aa1f669..3be16ec78d 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
@@ -74,6 +74,8 @@ mobile_apis::AppHMIType::eType StringToAppHMIType(const std::string& str) {
return mobile_apis::AppHMIType::TESTING;
} else if ("SYSTEM" == str) {
return mobile_apis::AppHMIType::SYSTEM;
+ } else if ("PROJECTION" == str) {
+ return mobile_apis::AppHMIType::PROJECTION;
} else {
return mobile_apis::AppHMIType::INVALID_ENUM;
}
@@ -90,7 +92,8 @@ std::string AppHMITypeToString(mobile_apis::AppHMIType::eType type) {
{mobile_apis::AppHMIType::SOCIAL, "SOCIAL"},
{mobile_apis::AppHMIType::BACKGROUND_PROCESS, "BACKGROUND_PROCESS"},
{mobile_apis::AppHMIType::TESTING, "TESTING"},
- {mobile_apis::AppHMIType::SYSTEM, "SYSTEM"}};
+ {mobile_apis::AppHMIType::SYSTEM, "SYSTEM"},
+ {mobile_apis::AppHMIType::PROJECTION, "PROJECTION"}};
std::map<mobile_apis::AppHMIType::eType, std::string>::const_iterator iter =
app_hmi_type_map.find(type);
@@ -319,6 +322,11 @@ void RegisterAppInterfaceRequest::Run() {
app_type.getElement(i).asUInt())) {
application->set_voice_communication_supported(true);
}
+ if (mobile_apis::AppHMIType::PROJECTION ==
+ static_cast<mobile_apis::AppHMIType::eType>(
+ app_type.getElement(i).asUInt())) {
+ application->SetMobileProjectionEnabled(true);
+ }
}
}
diff --git a/src/components/application_manager/src/hmi_state.cc b/src/components/application_manager/src/hmi_state.cc
index 1f05232476..aad927cc6a 100644
--- a/src/components/application_manager/src/hmi_state.cc
+++ b/src/components/application_manager/src/hmi_state.cc
@@ -1,3 +1,4 @@
+
/*
* Copyright (c) 2015, Ford Motor Company
* All rights reserved.
@@ -74,6 +75,11 @@ bool HmiState::is_voice_communication_app(const uint32_t app_id) const {
return app ? app->is_voice_communication_supported() : false;
}
+bool HmiState::is_mobile_projection_app(const uint32_t app_id) const {
+ const ApplicationSharedPtr app = app_mngr_.application(app_id);
+ return app ? app->MobileProjectionEnabled() : false;
+}
+
mobile_apis::AudioStreamingState::eType VRHmiState::audio_streaming_state()
const {
using namespace mobile_apis;
@@ -133,7 +139,7 @@ mobile_apis::HMILevel::eType PhoneCallHmiState::hmi_level() const {
HMILevel::HMI_NONE)) {
return parent()->hmi_level();
}
- if (is_navi_app(app_id_)) {
+ if (is_navi_app(app_id_) || is_mobile_projection_app(app_id_)) {
return HMILevel::HMI_LIMITED;
}
if (!is_media_app(app_id_)) {
diff --git a/src/components/application_manager/src/state_controller_impl.cc b/src/components/application_manager/src/state_controller_impl.cc
index 06a7e508e5..c9a80e8089 100644
--- a/src/components/application_manager/src/state_controller_impl.cc
+++ b/src/components/application_manager/src/state_controller_impl.cc
@@ -363,7 +363,7 @@ bool StateControllerImpl::IsResumptionAllowed(ApplicationSharedPtr app,
}
if (IsTempStateActive(HmiState::StateID::STATE_ID_EMBEDDED_NAVI) &&
- app->is_navi()) {
+ (app->is_navi() || app->MobileProjectionEnabled())) {
LOG4CXX_DEBUG(logger_,
"Resumption for navi app is not allowed. "
<< "EMBEDDED_NAVI event is active");
@@ -556,12 +556,19 @@ bool StateControllerImpl::IsSameAppType(ApplicationConstSharedPtr app1,
ApplicationConstSharedPtr app2) {
const bool both_media =
app1->is_media_application() && app2->is_media_application();
+
const bool both_navi = app1->is_navi() && app2->is_navi();
+
const bool both_vc = app1->is_voice_communication_supported() &&
- app2->is_voice_communication_supported();
+ app2->is_voice_communication_supported();
+
const bool both_simple =
!app1->IsAudioApplication() && !app2->IsAudioApplication();
- return both_simple || both_media || both_navi || both_vc;
+
+ const bool both_projection = app1->MobileProjectionEnabled() &&
+ app2->MobileProjectionEnabled();
+
+ return both_simple || both_media || both_navi || both_vc || both_projection;
}
void StateControllerImpl::on_event(const event_engine::Event& event) {
diff --git a/src/components/application_manager/test/application_impl_test.cc b/src/components/application_manager/test/application_impl_test.cc
index 54414a93de..6e98965e5c 100644
--- a/src/components/application_manager/test/application_impl_test.cc
+++ b/src/components/application_manager/test/application_impl_test.cc
@@ -569,12 +569,14 @@ TEST_F(ApplicationImplTest, ChangeSupportingAppHMIType_TypeNotNaviNotVoice) {
EXPECT_FALSE(app_impl->is_navi());
EXPECT_FALSE(app_impl->is_voice_communication_supported());
+ EXPECT_FALSE(app_impl->MobileProjectionEnabled());
app_impl->set_app_types(type_media);
app_impl->ChangeSupportingAppHMIType();
EXPECT_FALSE(app_impl->is_navi());
EXPECT_FALSE(app_impl->is_voice_communication_supported());
+ EXPECT_FALSE(app_impl->MobileProjectionEnabled());
}
TEST_F(ApplicationImplTest, ChangeSupportingAppHMIType_TypeIsVoice) {
@@ -583,12 +585,14 @@ TEST_F(ApplicationImplTest, ChangeSupportingAppHMIType_TypeIsVoice) {
EXPECT_FALSE(app_impl->is_navi());
EXPECT_FALSE(app_impl->is_voice_communication_supported());
+ EXPECT_FALSE(app_impl->MobileProjectionEnabled());
app_impl->set_app_types(type_comm);
app_impl->ChangeSupportingAppHMIType();
EXPECT_FALSE(app_impl->is_navi());
EXPECT_TRUE(app_impl->is_voice_communication_supported());
+ EXPECT_FALSE(app_impl->MobileProjectionEnabled());
}
TEST_F(ApplicationImplTest, ChangeSupportingAppHMIType_TypeIsNavi) {
@@ -597,12 +601,14 @@ TEST_F(ApplicationImplTest, ChangeSupportingAppHMIType_TypeIsNavi) {
EXPECT_FALSE(app_impl->is_navi());
EXPECT_FALSE(app_impl->is_voice_communication_supported());
+ EXPECT_FALSE(app_impl->MobileProjectionEnabled());
app_impl->set_app_types(type_navi);
app_impl->ChangeSupportingAppHMIType();
EXPECT_TRUE(app_impl->is_navi());
EXPECT_FALSE(app_impl->is_voice_communication_supported());
+ EXPECT_FALSE(app_impl->MobileProjectionEnabled());
}
TEST_F(ApplicationImplTest, ChangeSupportingAppHMIType_TypeIsNaviAndVoice) {
@@ -613,12 +619,33 @@ TEST_F(ApplicationImplTest, ChangeSupportingAppHMIType_TypeIsNaviAndVoice) {
EXPECT_FALSE(app_impl->is_navi());
EXPECT_FALSE(app_impl->is_voice_communication_supported());
+ EXPECT_FALSE(app_impl->MobileProjectionEnabled());
app_impl->set_app_types(app_types);
app_impl->ChangeSupportingAppHMIType();
EXPECT_TRUE(app_impl->is_navi());
EXPECT_TRUE(app_impl->is_voice_communication_supported());
+ EXPECT_FALSE(app_impl->MobileProjectionEnabled());
+}
+
+TEST_F(ApplicationImplTest, ChangeSupportingAppHMIType_TypeIsNaviAndVoiceAndProjection) {
+ smart_objects::SmartObject app_types;
+ app_types[0] = AppHMIType::NAVIGATION;
+ app_types[1] = AppHMIType::COMMUNICATION;
+ app_types[2] = AppHMIType::MEDIA;
+ app_types[3] = AppHMIType::PROJECTION;
+
+ EXPECT_FALSE(app_impl->is_navi());
+ EXPECT_FALSE(app_impl->is_voice_communication_supported());
+ EXPECT_FALSE(app_impl->MobileProjectionEnabled());
+
+ app_impl->set_app_types(app_types);
+ app_impl->ChangeSupportingAppHMIType();
+
+ EXPECT_TRUE(app_impl->is_navi());
+ EXPECT_TRUE(app_impl->is_voice_communication_supported());
+ EXPECT_TRUE(app_impl->MobileProjectionEnabled());
}
TEST_F(ApplicationImplTest, UpdateHash_AppMngrNotSuspended) {
diff --git a/src/components/application_manager/test/commands/mobile/on_touch_event_notification_test.cc b/src/components/application_manager/test/commands/mobile/on_touch_event_notification_test.cc
index 466facec1f..c90991fdf7 100644
--- a/src/components/application_manager/test/commands/mobile/on_touch_event_notification_test.cc
+++ b/src/components/application_manager/test/commands/mobile/on_touch_event_notification_test.cc
@@ -76,10 +76,16 @@ TEST_F(OnTouchEventNotificationTest, Run_AppIsNotFullscreen_UNSUCCESS) {
std::vector<ApplicationSharedPtr> applications_with_navi;
applications_with_navi.push_back(mock_app);
+ std::vector<ApplicationSharedPtr> applications_with_mobile_projection;
+ applications_with_mobile_projection.push_back(mock_app);
+
EXPECT_CALL(app_mngr_, applications_with_navi())
.WillOnce(Return(applications_with_navi));
- EXPECT_CALL(*mock_app, IsFullscreen()).WillOnce(Return(false));
+ EXPECT_CALL(app_mngr_, applications_with_mobile_projection())
+ .WillOnce(Return(applications_with_mobile_projection));
+
+ EXPECT_CALL(*mock_app, IsFullscreen()).WillRepeatedly(Return(false));
EXPECT_CALL(*mock_app, app_id()).Times(0);
@@ -118,14 +124,20 @@ TEST_F(OnTouchEventNotificationTest, Run_NotEmptyListOfAppsWithNavi_SUCCESS) {
std::vector<ApplicationSharedPtr> applications_with_navi;
applications_with_navi.push_back(mock_app);
+ std::vector<ApplicationSharedPtr> applications_with_mobile_projection;
+ applications_with_mobile_projection.push_back(mock_app);
+
EXPECT_CALL(app_mngr_, applications_with_navi())
.WillOnce(Return(applications_with_navi));
- EXPECT_CALL(*mock_app, IsFullscreen()).WillOnce(Return(true));
+ EXPECT_CALL(app_mngr_, applications_with_mobile_projection())
+ .WillOnce(Return(applications_with_mobile_projection));
+
+ EXPECT_CALL(*mock_app, IsFullscreen()).WillRepeatedly(Return(true));
- EXPECT_CALL(*mock_app, app_id()).WillOnce(Return(kAppId));
+ EXPECT_CALL(*mock_app, app_id()).WillRepeatedly(Return(kAppId));
- EXPECT_CALL(app_mngr_, SendMessageToMobile(CheckMessageData(), _));
+ EXPECT_CALL(app_mngr_, SendMessageToMobile(CheckMessageData(), _)).Times(2);
command_->Run();
}
diff --git a/src/components/application_manager/test/include/application_manager/mock_application.h b/src/components/application_manager/test/include/application_manager/mock_application.h
index 2617f777bb..b56175d44b 100644
--- a/src/components/application_manager/test/include/application_manager/mock_application.h
+++ b/src/components/application_manager/test/include/application_manager/mock_application.h
@@ -59,6 +59,8 @@ class MockApplication : public ::application_manager::Application {
MOCK_METHOD0(ChangeSupportingAppHMIType, void());
MOCK_CONST_METHOD0(is_navi, bool());
MOCK_METHOD1(set_is_navi, void(bool allow));
+ MOCK_CONST_METHOD0(MobileProjectionEnabled, bool());
+ MOCK_METHOD1(SetMobileProjectionEnabled, void(bool allow));
MOCK_CONST_METHOD0(video_streaming_approved, bool());
MOCK_METHOD1(set_video_streaming_approved, void(bool state));
MOCK_CONST_METHOD0(audio_streaming_approved, bool());
diff --git a/src/components/include/application_manager/application_manager.h b/src/components/include/application_manager/application_manager.h
index 180be220cc..7b4f55b17f 100644
--- a/src/components/include/application_manager/application_manager.h
+++ b/src/components/include/application_manager/application_manager.h
@@ -157,6 +157,7 @@ class ApplicationManager {
uint32_t button) = 0;
virtual std::vector<ApplicationSharedPtr> applications_with_navi() = 0;
+ virtual std::vector<ApplicationSharedPtr> applications_with_mobile_projection() = 0;
/**
* @brief Returns media application with LIMITED HMI Level if exists
*
@@ -182,6 +183,8 @@ class ApplicationManager {
*/
virtual ApplicationSharedPtr get_limited_voice_application() const = 0;
+ virtual ApplicationSharedPtr get_limited_mobile_projection_application() const = 0;
+
/**
* @brief Retrieves application id associated with correlation id
*
diff --git a/src/components/include/test/application_manager/mock_application_manager.h b/src/components/include/test/application_manager/mock_application_manager.h
index fc9b213d04..fb15435ca0 100644
--- a/src/components/include/test/application_manager/mock_application_manager.h
+++ b/src/components/include/test/application_manager/mock_application_manager.h
@@ -85,12 +85,16 @@ class MockApplicationManager : public application_manager::ApplicationManager {
std::vector<application_manager::ApplicationSharedPtr>(uint32_t button));
MOCK_METHOD0(applications_with_navi,
std::vector<application_manager::ApplicationSharedPtr>());
+ MOCK_METHOD0(applications_with_mobile_projection,
+ std::vector<application_manager::ApplicationSharedPtr>());
MOCK_CONST_METHOD0(get_limited_media_application,
application_manager::ApplicationSharedPtr());
MOCK_CONST_METHOD0(get_limited_navi_application,
application_manager::ApplicationSharedPtr());
MOCK_CONST_METHOD0(get_limited_voice_application,
application_manager::ApplicationSharedPtr());
+ MOCK_CONST_METHOD0(get_limited_mobile_projection_application,
+ application_manager::ApplicationSharedPtr());
MOCK_METHOD1(application_id, uint32_t(const int32_t correlation_id));
MOCK_METHOD2(set_application_id,
void(const int32_t correlation_id, const uint32_t app_id));
diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml
index 0d6d5fad3d..80ee97d908 100644
--- a/src/components/interfaces/HMI_API.xml
+++ b/src/components/interfaces/HMI_API.xml
@@ -234,6 +234,7 @@
<element name="BACKGROUND_PROCESS" />
<element name="TESTING" />
<element name="SYSTEM" />
+ <element name="PROJECTION" />
</enum>
<enum name="WayPointType">
diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml
index 953f270741..e482bf741c 100644
--- a/src/components/interfaces/MOBILE_API.xml
+++ b/src/components/interfaces/MOBILE_API.xml
@@ -2051,6 +2051,7 @@
<element name="BACKGROUND_PROCESS" />
<element name="TESTING" />
<element name="SYSTEM" />
+ <element name="PROJECTION" />
</enum>
<enum name="PredefinedLayout" platform="documentation">