summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Keeler <jacob.keeler@livioradio.com>2017-08-01 15:57:53 -0400
committerGitHub <noreply@github.com>2017-08-01 15:57:53 -0400
commitb5cbe0d2fd8e634b99b835b936967359da4f00a6 (patch)
treec588b8b7a580064c6d63f27a28d312ba059b3193
parentedb64e86292959ee93cb1b9482452e13156f928b (diff)
parent9a603de488006113c3474f401d3f3467d3f42e77 (diff)
downloadsdl_core-b5cbe0d2fd8e634b99b835b936967359da4f00a6.tar.gz
Merge pull request #1689 from JackLivio/feature/mobile_projection
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.h4
-rw-r--r--src/components/application_manager/include/application_manager/hmi_state.h2
-rw-r--r--src/components/application_manager/src/application_impl.cc16
-rw-r--r--src/components/application_manager/src/application_manager_impl.cc70
-rw-r--r--src/components/application_manager/src/commands/mobile/on_touch_event_notification.cc25
-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.cc28
-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.h5
-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
-rw-r--r--src/components/policy/policy_external/include/policy/policy_table/enums.h3
-rw-r--r--src/components/policy/policy_external/src/policy_table/enums.cc7
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_table/enums.h1
-rw-r--r--src/components/policy/policy_regular/src/policy_table/enums.cc7
21 files changed, 207 insertions, 28 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..63d9580758 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 set_mobile_projection_enabled(bool option) = 0;
+ virtual bool mobile_projection_enabled() 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..695d7ef9d5 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 set_mobile_projection_enabled(bool option);
+
+ bool mobile_projection_enabled() 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 0c8a30b47a..93c139963a 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,14 @@ 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..21039e1865 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::set_mobile_projection_enabled(bool option) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ mobile_projection_enabled_ = option;
+}
+
+bool ApplicationImpl::mobile_projection_enabled() const {
+ return mobile_projection_enabled_;
+}
+
struct StateIDComparator {
HmiState::StateID state_id_;
StateIDComparator(HmiState::StateID state_id) : state_id_(state_id) {}
diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc
index 8c792750a8..e7e7868102 100644
--- a/src/components/application_manager/src/application_manager_impl.cc
+++ b/src/components/application_manager/src/application_manager_impl.cc
@@ -291,6 +291,29 @@ ApplicationManagerImpl::applications_with_navi() {
DataAccessor<ApplicationSet> accessor = applications();
return FindAllApps(accessor, NaviAppPredicate);
}
+
+bool LimitedMobileProjectionPredicate(const ApplicationSharedPtr app) {
+ return app ? (app->mobile_projection_enabled() &&
+ 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->mobile_projection_enabled() : 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 +376,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->mobile_projection_enabled();
ApplicationSharedPtr active_app = active_application();
// Check app in FULL level
if (active_app.valid()) {
@@ -374,6 +398,10 @@ bool ApplicationManagerImpl::IsAppTypeExistsInFullOrLimited(
if (navi_state && active_app->is_navi()) {
return true;
}
+
+ if (mobile_projection_state && active_app->mobile_projection_enabled()) {
+ return true;
+ }
}
// Check LIMITED apps
@@ -398,6 +426,14 @@ 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,10 +1216,10 @@ bool ApplicationManagerImpl::OnServiceStartedCallback(
if (Compare<ServiceType, EQ, ONE>(
type, ServiceType::kMobileNav, ServiceType::kAudio)) {
- if (app->is_navi()) {
+ if (app->is_navi() || app->mobile_projection_enabled()) {
return StartNaviService(session_key, type);
} else {
- LOG4CXX_WARN(logger_, "Refuse not navi application");
+ LOG4CXX_WARN(logger_, "Refuse not navi/projection application");
}
} else {
LOG4CXX_WARN(logger_, "Refuse unknown service");
@@ -2901,8 +2937,10 @@ void ApplicationManagerImpl::ForbidStreaming(uint32_t app_id) {
LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr app = application(app_id);
- if (!app || !app->is_navi()) {
- LOG4CXX_DEBUG(logger_, "There is no navi application with id: " << app_id);
+ if (!app || (!app->is_navi() && !app->mobile_projection_enabled())) {
+ LOG4CXX_DEBUG(
+ logger_,
+ "There is no navi or projection application with id: " << app_id);
return;
}
@@ -2935,8 +2973,10 @@ void ApplicationManagerImpl::OnAppStreaming(
LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr app = application(app_id);
- if (!app || !app->is_navi()) {
- LOG4CXX_DEBUG(logger_, " There is no navi application with id: " << app_id);
+ if (!app || (!app->is_navi() && !app->mobile_projection_enabled())) {
+ LOG4CXX_DEBUG(
+ logger_,
+ " There is no navi or projection application with id: " << app_id);
return;
}
DCHECK_OR_RETURN_VOID(media_manager_);
@@ -2955,8 +2995,10 @@ void ApplicationManagerImpl::EndNaviServices(uint32_t app_id) {
LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr app = application(app_id);
- if (!app || !app->is_navi()) {
- LOG4CXX_DEBUG(logger_, "There is no navi application with id: " << app_id);
+ if (!app || (!app->is_navi() && !app->mobile_projection_enabled())) {
+ LOG4CXX_DEBUG(
+ logger_,
+ "There is no navi or projection application with id: " << app_id);
return;
}
@@ -3006,8 +3048,8 @@ void ApplicationManagerImpl::OnHMILevelChanged(
}
ApplicationSharedPtr app = application(app_id);
- if (!app || !app->is_navi()) {
- LOG4CXX_ERROR(logger_, "Navi application not found");
+ if (!app || (!app->is_navi() && !app->mobile_projection_enabled())) {
+ LOG4CXX_ERROR(logger_, "Navi/Projection application not found");
return;
}
@@ -3129,8 +3171,8 @@ void ApplicationManagerImpl::DisallowStreaming(uint32_t app_id) {
LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr app = application(app_id);
- if (!app || !app->is_navi()) {
- LOG4CXX_ERROR(logger_, "Navi application not found");
+ if (!app || (!app->is_navi() && !app->mobile_projection_enabled())) {
+ LOG4CXX_ERROR(logger_, "Navi/Projection application not found");
return;
}
@@ -3150,8 +3192,8 @@ void ApplicationManagerImpl::AllowStreaming(uint32_t app_id) {
LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr app = application(app_id);
- if (!app || !app->is_navi()) {
- LOG4CXX_ERROR(logger_, "Navi application not found");
+ if (!app || (!app->is_navi() && !app->mobile_projection_enabled())) {
+ LOG4CXX_ERROR(logger_, "Navi/Projection 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..2a9969eac4 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
@@ -50,17 +50,34 @@ OnTouchEventNotification::~OnTouchEventNotification() {}
void OnTouchEventNotification::Run() {
LOG4CXX_AUTO_TRACE(logger_);
- const std::vector<ApplicationSharedPtr>& applications =
+ const std::vector<ApplicationSharedPtr>& applications_with_navi =
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_with_navi.begin();
+
+ for (; applications_with_navi.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..52153647a7 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->set_mobile_projection_enabled(true);
+ }
}
}
diff --git a/src/components/application_manager/src/hmi_state.cc b/src/components/application_manager/src/hmi_state.cc
index 1f05232476..393a9d7784 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->mobile_projection_enabled() : 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..b456ff6abb 100644
--- a/src/components/application_manager/src/state_controller_impl.cc
+++ b/src/components/application_manager/src/state_controller_impl.cc
@@ -363,9 +363,9 @@ bool StateControllerImpl::IsResumptionAllowed(ApplicationSharedPtr app,
}
if (IsTempStateActive(HmiState::StateID::STATE_ID_EMBEDDED_NAVI) &&
- app->is_navi()) {
+ (app->is_navi() || app->mobile_projection_enabled())) {
LOG4CXX_DEBUG(logger_,
- "Resumption for navi app is not allowed. "
+ "Resumption for navi or projection app is not allowed. "
<< "EMBEDDED_NAVI event is active");
return false;
}
@@ -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();
+
const bool both_simple =
!app1->IsAudioApplication() && !app2->IsAudioApplication();
- return both_simple || both_media || both_navi || both_vc;
+
+ const bool both_projection =
+ app1->mobile_projection_enabled() && app2->mobile_projection_enabled();
+
+ 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..8f00284772 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->mobile_projection_enabled());
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->mobile_projection_enabled());
}
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->mobile_projection_enabled());
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->mobile_projection_enabled());
}
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->mobile_projection_enabled());
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->mobile_projection_enabled());
}
TEST_F(ApplicationImplTest, ChangeSupportingAppHMIType_TypeIsNaviAndVoice) {
@@ -613,12 +619,34 @@ TEST_F(ApplicationImplTest, ChangeSupportingAppHMIType_TypeIsNaviAndVoice) {
EXPECT_FALSE(app_impl->is_navi());
EXPECT_FALSE(app_impl->is_voice_communication_supported());
+ EXPECT_FALSE(app_impl->mobile_projection_enabled());
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->mobile_projection_enabled());
+}
+
+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->mobile_projection_enabled());
+
+ 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->mobile_projection_enabled());
}
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..3276e1f8f5 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(mobile_projection_enabled, bool());
+ MOCK_METHOD1(set_mobile_projection_enabled, 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..98bb341657 100644
--- a/src/components/include/application_manager/application_manager.h
+++ b/src/components/include/application_manager/application_manager.h
@@ -157,6 +157,8 @@ 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 +184,9 @@ 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 10660f982d..7a96e039ce 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 cac520d349..edc97bbd3f 100644
--- a/src/components/interfaces/MOBILE_API.xml
+++ b/src/components/interfaces/MOBILE_API.xml
@@ -2054,6 +2054,7 @@
<element name="BACKGROUND_PROCESS" />
<element name="TESTING" />
<element name="SYSTEM" />
+ <element name="PROJECTION" />
</enum>
<enum name="PredefinedLayout" platform="documentation">
diff --git a/src/components/policy/policy_external/include/policy/policy_table/enums.h b/src/components/policy/policy_external/include/policy/policy_table/enums.h
index 45fad03dae..4b0a7d74bc 100644
--- a/src/components/policy/policy_external/include/policy/policy_table/enums.h
+++ b/src/components/policy/policy_external/include/policy/policy_table/enums.h
@@ -119,7 +119,8 @@ enum AppHMIType {
AHT_SOCIAL,
AHT_BACKGROUND_PROCESS,
AHT_TESTING,
- AHT_SYSTEM
+ AHT_SYSTEM,
+ AHT_PROJECTION
};
bool IsValidEnum(AppHMIType val);
const char* EnumToJsonString(AppHMIType val);
diff --git a/src/components/policy/policy_external/src/policy_table/enums.cc b/src/components/policy/policy_external/src/policy_table/enums.cc
index e70167c94b..45db2cb469 100644
--- a/src/components/policy/policy_external/src/policy_table/enums.cc
+++ b/src/components/policy/policy_external/src/policy_table/enums.cc
@@ -438,6 +438,8 @@ bool IsValidEnum(AppHMIType val) {
return true;
case AHT_SYSTEM:
return true;
+ case AHT_PROJECTION:
+ return true;
default:
return false;
}
@@ -464,6 +466,8 @@ const char* EnumToJsonString(AppHMIType val) {
return "TESTING";
case AHT_SYSTEM:
return "SYSTEM";
+ case AHT_PROJECTION:
+ return "PROJECTION";
default:
return "";
}
@@ -499,6 +503,9 @@ bool EnumFromJsonString(const std::string& literal, AppHMIType* result) {
} else if ("SYSTEM" == literal) {
*result = AHT_SYSTEM;
return true;
+ } else if ("PROJECTION" == literal) {
+ *result = AHT_PROJECTION;
+ return true;
} else {
return false;
}
diff --git a/src/components/policy/policy_regular/include/policy/policy_table/enums.h b/src/components/policy/policy_regular/include/policy/policy_table/enums.h
index 0554e94722..876ca03a27 100644
--- a/src/components/policy/policy_regular/include/policy/policy_table/enums.h
+++ b/src/components/policy/policy_regular/include/policy/policy_table/enums.h
@@ -105,6 +105,7 @@ enum AppHMIType {
AHT_TESTING,
AHT_SYSTEM,
AHT_REMOTE_CONTROL,
+ AHT_PROJECTION
};
bool IsValidEnum(AppHMIType val);
const char* EnumToJsonString(AppHMIType val);
diff --git a/src/components/policy/policy_regular/src/policy_table/enums.cc b/src/components/policy/policy_regular/src/policy_table/enums.cc
index 26c7b96b32..6de065148a 100644
--- a/src/components/policy/policy_regular/src/policy_table/enums.cc
+++ b/src/components/policy/policy_regular/src/policy_table/enums.cc
@@ -324,6 +324,8 @@ bool IsValidEnum(AppHMIType val) {
return true;
case AHT_SYSTEM:
return true;
+ case AHT_PROJECTION:
+ return true;
default:
return false;
}
@@ -350,6 +352,8 @@ const char* EnumToJsonString(AppHMIType val) {
return "TESTING";
case AHT_SYSTEM:
return "SYSTEM";
+ case AHT_PROJECTION:
+ return "PROJECTION";
default:
return "";
}
@@ -385,6 +389,9 @@ bool EnumFromJsonString(const std::string& literal, AppHMIType* result) {
} else if ("SYSTEM" == literal) {
*result = AHT_SYSTEM;
return true;
+ } else if ("PROJECTION" == literal) {
+ *result = AHT_PROJECTION;
+ return true;
} else {
return false;
}