summaryrefslogtreecommitdiff
path: root/src/components/application_manager/rpc_plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/application_manager/rpc_plugins')
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/CMakeLists.txt2
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/get_app_service_data_request.h3
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/get_app_service_data_response_from_mobile.h1
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_app_extension.cc8
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_app_service_activation_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_request_to_hmi.cc1
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_response_from_hmi.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_response_to_hmi.cc1
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_records_request.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_perform_app_service_interaction_request_from_hmi.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_publish_app_service_request.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_request.cc31
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_request_to_mobile.cc1
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_response.cc1
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_response_from_mobile.cc10
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/on_app_service_data_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_request.cc11
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_request_to_mobile.cc1
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_response.cc1
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/publish_app_service_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/publish_app_service_response.cc1
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/CMakeLists.txt38
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc151
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc135
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_time_ready_notification.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_bc_system_capability_updated_notification.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_file_request.cc3
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_request.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_capability_updated_notification.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/hmi_command_factory.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc16
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_request_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc30
34 files changed, 421 insertions, 67 deletions
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/CMakeLists.txt b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/CMakeLists.txt
index 2bdc150906..1e23aac8ee 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/CMakeLists.txt
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/CMakeLists.txt
@@ -80,5 +80,5 @@ install(TARGETS app_service_rpc_plugin
)
if(BUILD_TESTS)
- # add_subdirectory(test)
+ add_subdirectory(test)
endif()
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/get_app_service_data_request.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/get_app_service_data_request.h
index 8295e855fa..7c80ec5e03 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/get_app_service_data_request.h
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/get_app_service_data_request.h
@@ -77,7 +77,8 @@ class GetAppServiceDataRequest : public app_mngr::commands::CommandRequestImpl {
virtual void on_event(const app_mngr::event_engine::MobileEvent& event);
private:
- AppServiceRpcPlugin* plugin_;
+ void HandleSubscribe();
+
DISALLOW_COPY_AND_ASSIGN(GetAppServiceDataRequest);
};
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/get_app_service_data_response_from_mobile.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/get_app_service_data_response_from_mobile.h
index 1411b23e5a..7e2b26d8fb 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/get_app_service_data_response_from_mobile.h
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/get_app_service_data_response_from_mobile.h
@@ -70,7 +70,6 @@ class GetAppServiceDataResponseFromMobile
virtual void Run();
private:
- AppServiceRpcPlugin* plugin_;
DISALLOW_COPY_AND_ASSIGN(GetAppServiceDataResponseFromMobile);
};
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_app_extension.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_app_extension.cc
index 63812056f1..6d8b0c08cc 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_app_extension.cc
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_app_extension.cc
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2018, Ford Motor Company
+ Copyright (c) 2019, Ford Motor Company, Livio
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -13,9 +13,9 @@
disclaimer in the documentation and/or other materials provided with the
distribution.
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_app_service_activation_request.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_app_service_activation_request.cc
index 7c32d9bbe1..fd7312ca98 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_app_service_activation_request.cc
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_app_service_activation_request.cc
@@ -32,6 +32,8 @@
#include "app_service_rpc_plugin/commands/hmi/as_app_service_activation_request.h"
+#include "application_manager/app_service_manager.h"
+
namespace app_service_rpc_plugin {
using namespace application_manager;
namespace commands {
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_request_to_hmi.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_request_to_hmi.cc
index 822cd0a29b..635cd7319a 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_request_to_hmi.cc
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_request_to_hmi.cc
@@ -33,7 +33,6 @@
#include "app_service_rpc_plugin/commands/hmi/as_get_app_service_data_request_to_hmi.h"
#include "application_manager/application_impl.h"
#include "application_manager/rpc_service.h"
-#include "interfaces/MOBILE_API.h"
namespace app_service_rpc_plugin {
using namespace application_manager;
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_response_from_hmi.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_response_from_hmi.cc
index 9ce6ffdb50..c0b1b274fb 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_response_from_hmi.cc
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_response_from_hmi.cc
@@ -33,7 +33,7 @@
#include "app_service_rpc_plugin/commands/hmi/as_get_app_service_data_response_from_hmi.h"
#include "application_manager/application_impl.h"
#include "application_manager/rpc_service.h"
-#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
#include "application_manager/message_helper.h"
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_response_to_hmi.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_response_to_hmi.cc
index 9e2289d39e..b489ec4765 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_response_to_hmi.cc
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_response_to_hmi.cc
@@ -33,7 +33,6 @@
#include "app_service_rpc_plugin/commands/hmi/as_get_app_service_data_response_to_hmi.h"
#include "application_manager/application_impl.h"
#include "application_manager/rpc_service.h"
-#include "interfaces/MOBILE_API.h"
namespace app_service_rpc_plugin {
using namespace application_manager;
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_records_request.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_records_request.cc
index 1131448d2f..fa704c1995 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_records_request.cc
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_records_request.cc
@@ -32,6 +32,8 @@
#include "app_service_rpc_plugin/commands/hmi/as_get_app_service_records_request.h"
+#include "application_manager/app_service_manager.h"
+
namespace app_service_rpc_plugin {
using namespace application_manager;
namespace commands {
@@ -61,7 +63,7 @@ void ASGetAppServiceRecordsRequest::Run() {
smart_objects::SmartObject records =
smart_objects::SmartObject(smart_objects::SmartType_Array);
std::vector<smart_objects::SmartObject> service_records =
- application_manager_.GetAppServiceManager().GetAllServices();
+ application_manager_.GetAppServiceManager().GetAllServiceRecords();
int index = 0;
for (auto& record : service_records) {
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_perform_app_service_interaction_request_from_hmi.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_perform_app_service_interaction_request_from_hmi.cc
index 2b66993d8f..70a5a10be0 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_perform_app_service_interaction_request_from_hmi.cc
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_perform_app_service_interaction_request_from_hmi.cc
@@ -31,6 +31,8 @@
*/
#include "app_service_rpc_plugin/commands/hmi/as_perform_app_service_interaction_request_from_hmi.h"
+
+#include "application_manager/app_service_manager.h"
#include "application_manager/message_helper.h"
namespace app_service_rpc_plugin {
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_publish_app_service_request.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_publish_app_service_request.cc
index b816016fa7..637240666d 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_publish_app_service_request.cc
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_publish_app_service_request.cc
@@ -31,6 +31,8 @@
*/
#include "app_service_rpc_plugin/commands/hmi/as_publish_app_service_request.h"
+
+#include "application_manager/app_service_manager.h"
#include "application_manager/message_helper.h"
namespace app_service_rpc_plugin {
@@ -59,8 +61,8 @@ void ASPublishAppServiceRequest::Run() {
smart_objects::SmartObject manifest =
(*message_)[strings::msg_params][strings::app_service_manifest];
smart_objects::SmartObject service_record =
- application_manager_.GetAppServiceManager().PublishAppService(
- manifest, false, UINT32_MAX);
+ application_manager_.GetAppServiceManager().PublishAppService(manifest,
+ false);
response_params[strings::app_service_record] = service_record;
SendResponse(true,
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_request.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_request.cc
index 0d387785ee..7c2e62abe2 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_request.cc
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_request.cc
@@ -52,26 +52,24 @@ GetAppServiceDataRequest::GetAppServiceDataRequest(
application_manager,
rpc_service,
hmi_capabilities,
- policy_handler)
- , plugin_(NULL) {
- auto plugin = (application_manager.GetPluginManager().FindPluginToProcess(
- mobile_apis::FunctionID::GetAppServiceDataID,
- app_mngr::commands::Command::CommandSource::SOURCE_MOBILE));
- if (plugin) {
- plugin_ = dynamic_cast<AppServiceRpcPlugin*>(&(*plugin));
- }
-}
+ policy_handler) {}
GetAppServiceDataRequest::~GetAppServiceDataRequest() {}
void GetAppServiceDataRequest::Run() {
LOG4CXX_AUTO_TRACE(logger_);
+ SendProviderRequest(mobile_apis::FunctionID::GetAppServiceDataID,
+ hmi_apis::FunctionID::AppService_GetAppServiceData,
+ &(*message_),
+ true);
+}
+
+void GetAppServiceDataRequest::HandleSubscribe() {
std::string service_type =
(*message_)[strings::msg_params][strings::service_type].asString();
-
ApplicationSharedPtr app = application_manager_.application(connection_key());
- if ((*message_)[strings::msg_params].keyExists(strings::subscribe)) {
+ if (app && (*message_)[strings::msg_params].keyExists(strings::subscribe)) {
bool subscribe =
(*message_)[strings::msg_params][strings::subscribe].asBool();
auto& ext = AppServiceAppExtension::ExtractASExtension(*app);
@@ -81,11 +79,6 @@ void GetAppServiceDataRequest::Run() {
ext.UnsubscribeFromAppService(service_type);
}
}
-
- SendProviderRequest(mobile_apis::FunctionID::GetAppServiceDataID,
- hmi_apis::FunctionID::AppService_GetAppServiceData,
- &(*message_),
- true);
}
void GetAppServiceDataRequest::on_event(
@@ -97,6 +90,9 @@ void GetAppServiceDataRequest::on_event(
mobile_apis::Result::eType result = static_cast<mobile_apis::Result::eType>(
msg_params[strings::result_code].asInt());
bool success = IsMobileResultSuccess(result);
+ if (success) {
+ HandleSubscribe();
+ }
const char* info = msg_params.keyExists(strings::info)
? msg_params[strings::info].asCharArray()
@@ -118,6 +114,9 @@ void GetAppServiceDataRequest::on_event(const event_engine::Event& event) {
MessageHelper::HMIToMobileResult(hmi_result);
bool success = PrepareResultForMobileResponse(
hmi_result, HmiInterfaces::HMI_INTERFACE_AppService);
+ if (success) {
+ HandleSubscribe();
+ }
const char* info = msg_params.keyExists(strings::info)
? msg_params[strings::info].asCharArray()
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_request_to_mobile.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_request_to_mobile.cc
index 2bf81b3a2d..0af1a5436b 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_request_to_mobile.cc
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_request_to_mobile.cc
@@ -33,7 +33,6 @@
#include "app_service_rpc_plugin/commands/mobile/get_app_service_data_request_to_mobile.h"
#include "application_manager/application_impl.h"
#include "application_manager/rpc_service.h"
-#include "interfaces/MOBILE_API.h"
namespace app_service_rpc_plugin {
using namespace application_manager;
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_response.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_response.cc
index df7bbba2f7..32ad8e014d 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_response.cc
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_response.cc
@@ -33,7 +33,6 @@
#include "app_service_rpc_plugin/commands/mobile/get_app_service_data_response.h"
#include "application_manager/application_impl.h"
#include "application_manager/rpc_service.h"
-#include "interfaces/MOBILE_API.h"
namespace app_service_rpc_plugin {
using namespace application_manager;
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_response_from_mobile.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_response_from_mobile.cc
index f8c1f3892d..90fca04eb2 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_response_from_mobile.cc
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_response_from_mobile.cc
@@ -50,15 +50,7 @@ GetAppServiceDataResponseFromMobile::GetAppServiceDataResponseFromMobile(
application_manager,
rpc_service,
hmi_capabilities,
- policy_handler)
- , plugin_(NULL) {
- auto plugin = (application_manager.GetPluginManager().FindPluginToProcess(
- mobile_apis::FunctionID::PublishAppServiceID,
- app_mngr::commands::Command::CommandSource::SOURCE_MOBILE));
- if (plugin) {
- plugin_ = dynamic_cast<AppServiceRpcPlugin*>(&(*plugin));
- }
-}
+ policy_handler) {}
GetAppServiceDataResponseFromMobile::~GetAppServiceDataResponseFromMobile() {}
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/on_app_service_data_notification.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/on_app_service_data_notification.cc
index 2c6ba414e0..fd3891e0e8 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/on_app_service_data_notification.cc
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/on_app_service_data_notification.cc
@@ -31,7 +31,9 @@
*/
#include "app_service_rpc_plugin/commands/mobile/on_app_service_data_notification.h"
+
#include "app_service_rpc_plugin/app_service_app_extension.h"
+#include "application_manager/app_service_manager.h"
#include "application_manager/application_impl.h"
#include "application_manager/helpers/application_helper.h"
#include "application_manager/message_helper.h"
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_request.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_request.cc
index 9e262f0ca3..4046ac7379 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_request.cc
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_request.cc
@@ -31,6 +31,8 @@
*/
#include "app_service_rpc_plugin/commands/mobile/perform_app_service_interaction_request.h"
+
+#include "application_manager/app_service_manager.h"
#include "application_manager/application_impl.h"
#include "application_manager/message_helper.h"
#include "interfaces/MOBILE_API.h"
@@ -73,6 +75,15 @@ void PerformAppServiceInteractionRequest::Run() {
return;
}
+ if (!service->record[strings::service_manifest][strings::allow_app_consumers]
+ .asBool()) {
+ SendResponse(
+ false,
+ mobile_apis::Result::REJECTED,
+ "The requested service ID does not allow mobile app consumers");
+ return;
+ }
+
bool request_service_active = false;
if (msg_params.keyExists(strings::request_service_active)) {
request_service_active =
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_request_to_mobile.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_request_to_mobile.cc
index 8d71174c8d..2a7b644cb3 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_request_to_mobile.cc
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_request_to_mobile.cc
@@ -32,7 +32,6 @@
#include "app_service_rpc_plugin/commands/mobile/perform_app_service_interaction_request_to_mobile.h"
#include "application_manager/application_impl.h"
-#include "interfaces/MOBILE_API.h"
namespace app_service_rpc_plugin {
using namespace application_manager;
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_response.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_response.cc
index 774ec93720..5e84f42c34 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_response.cc
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_response.cc
@@ -32,7 +32,6 @@
#include "app_service_rpc_plugin/commands/mobile/perform_app_service_interaction_response.h"
#include "application_manager/application_impl.h"
-#include "interfaces/MOBILE_API.h"
namespace app_service_rpc_plugin {
using namespace application_manager;
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/publish_app_service_request.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/publish_app_service_request.cc
index 22d8e50c3a..171c10913e 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/publish_app_service_request.cc
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/publish_app_service_request.cc
@@ -31,6 +31,8 @@
*/
#include "app_service_rpc_plugin/commands/mobile/publish_app_service_request.h"
+
+#include "application_manager/app_service_manager.h"
#include "application_manager/application_impl.h"
#include "application_manager/message_helper.h"
#include "application_manager/rpc_service.h"
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/publish_app_service_response.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/publish_app_service_response.cc
index b1136c79d0..d1bfc6e154 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/publish_app_service_response.cc
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/publish_app_service_response.cc
@@ -34,7 +34,6 @@
#include "application_manager/application_impl.h"
#include "application_manager/message_helper.h"
#include "application_manager/rpc_service.h"
-#include "interfaces/MOBILE_API.h"
namespace app_service_rpc_plugin {
using namespace application_manager;
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/CMakeLists.txt b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/CMakeLists.txt
new file mode 100644
index 0000000000..97d2efaf07
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/CMakeLists.txt
@@ -0,0 +1,38 @@
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
+
+include_directories(
+ ${GMOCK_INCLUDE_DIRECTORY}
+ ${COMPONENTS_DIR}/application_manager/rpc_plugins/app_service_rpc_plugin/include
+ ${COMPONENTS_DIR}/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/
+ ${COMPONENTS_DIR}/application_manager/test/include/
+ ${POLICY_MOCK_INCLUDE_PATH}/
+ ${CMAKE_SOURCE_DIR}/src
+)
+
+
+set(COMMANDS_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR}/commands)
+
+file(GLOB SOURCES
+ ${COMPONENTS_DIR}/application_manager/test/mock_message_helper.cc
+ ${COMPONENTS_DIR}/application_manager/test/mock_application_helper.cc
+ ${COMPONENTS_DIR}/application_manager/src/smart_object_keys.cc
+ ${COMMANDS_TEST_DIR}/hmi/*
+ ${COMMANDS_TEST_DIR}/mobile/*
+ ${COMPONENTS_DIR}/application_manager/src/message.cc
+ ${COMPONENTS_DIR}/application_manager/src/event_engine/*
+)
+
+set(LIBRARIES
+ gmock
+ Utils
+ SmartObjects
+ HMI_API
+ MOBILE_API
+ connectionHandler
+ app_service_rpc_plugin
+ sdl_rpc_plugin
+ jsoncpp
+ Policy
+)
+
+create_cotired_test("app_services_commands_test" "${SOURCES}" "${LIBRARIES}" )
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc
new file mode 100644
index 0000000000..8ef87b6de9
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc
@@ -0,0 +1,151 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/command_request_test.h"
+
+#include <stdint.h>
+#include <string>
+#include <vector>
+#include "gtest/gtest.h"
+
+#include "hmi/as_app_service_activation_request.h"
+#include "hmi/as_app_service_activation_response.h"
+#include "hmi/as_get_active_service_consent_request.h"
+#include "hmi/as_get_active_service_consent_response.h"
+#include "hmi/as_get_app_service_data_request_from_hmi.h"
+#include "hmi/as_get_app_service_data_request_to_hmi.h"
+#include "hmi/as_get_app_service_data_response_from_hmi.h"
+#include "hmi/as_get_app_service_data_response_to_hmi.h"
+#include "hmi/as_get_app_service_records_request.h"
+#include "hmi/as_get_app_service_records_response.h"
+#include "hmi/as_perform_app_service_interaction_request_from_hmi.h"
+#include "hmi/as_perform_app_service_interaction_request_to_hmi.h"
+#include "hmi/as_perform_app_service_interaction_response_from_hmi.h"
+#include "hmi/as_perform_app_service_interaction_response_to_hmi.h"
+#include "hmi/as_publish_app_service_request.h"
+#include "hmi/as_publish_app_service_response.h"
+#include "hmi/on_as_app_service_data_notification.h"
+#include "hmi/on_as_app_service_data_notification_from_hmi.h"
+
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application_manager_settings.h"
+#include "application_manager/mock_event_dispatcher.h"
+
+namespace am = application_manager;
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace dummy_hmi_commands_test {
+
+namespace commands = app_service_rpc_plugin::commands;
+
+using ::testing::_;
+using ::testing::NotNull;
+using ::testing::Types;
+using application_manager::commands::MessageSharedPtr;
+using ::test::components::event_engine_test::MockEventDispatcher;
+using ::test::components::application_manager_test::MockApplicationManager;
+using ::test::components::application_manager_test::
+ MockApplicationManagerSettings;
+using ::application_manager::ApplicationSharedPtr;
+using ::test::components::application_manager_test::MockApplication;
+
+template <class Command>
+class HMICommandsTest : public components::commands_test::CommandRequestTest<
+ CommandsTestMocks::kIsNice> {
+ public:
+ typedef Command CommandType;
+
+ void InitCommand(const uint32_t& timeout) OVERRIDE {
+ stream_retry_.first = 0;
+ stream_retry_.second = 0;
+ EXPECT_CALL(app_mngr_settings_, default_timeout())
+ .WillOnce(ReturnRef(timeout));
+ ON_CALL(app_mngr_, event_dispatcher())
+ .WillByDefault(ReturnRef(event_dispatcher_));
+ ON_CALL(app_mngr_, get_settings())
+ .WillByDefault(ReturnRef(app_mngr_settings_));
+ ON_CALL(app_mngr_settings_, start_stream_retry_amount())
+ .WillByDefault(ReturnRef(stream_retry_));
+ }
+
+ protected:
+ std::pair<uint32_t, int32_t> stream_retry_;
+};
+
+template <class Command>
+class HMICommandsTestFirst : public HMICommandsTest<Command> {
+ public:
+ using typename HMICommandsTest<Command>::CommandType;
+};
+
+/* macro TYPED_TEST_CASE takes max 50 args. That is why there are few
+ * TYPED_TEST_CASE for HMI and mobile commands
+ */
+
+typedef Types<commands::ASAppServiceActivationRequest,
+ commands::ASAppServiceActivationResponse,
+ commands::ASGetActiveServiceConsentRequest,
+ commands::ASGetActiveServiceConsentResponse,
+ commands::ASPerformAppServiceInteractionRequestFromHMI,
+ commands::ASGetAppServiceDataRequestToHMI,
+ commands::ASGetAppServiceDataResponseFromHMI,
+ commands::ASGetAppServiceDataResponseToHMI,
+ commands::ASGetAppServiceRecordsRequest,
+ commands::ASGetAppServiceRecordsResponse,
+ commands::ASPerformAppServiceInteractionRequestFromHMI,
+ commands::ASPerformAppServiceInteractionRequestToHMI,
+ commands::ASPerformAppServiceInteractionResponseFromHMI,
+ commands::ASPerformAppServiceInteractionResponseToHMI,
+ commands::ASPublishAppServiceRequest,
+ commands::ASPublishAppServiceResponse,
+ commands::OnASAppServiceDataNotification,
+ commands::OnASAppServiceDataNotificationFromHMI>
+ HMICommandsListFirst;
+
+TYPED_TEST_CASE(HMICommandsTestFirst, HMICommandsListFirst);
+
+TYPED_TEST(HMICommandsTestFirst, CtorAndDtorCall) {
+ std::shared_ptr<typename TestFixture::CommandType> command =
+ this->template CreateCommand<typename TestFixture::CommandType>();
+ EXPECT_NE(command.use_count(), 0);
+}
+
+} // namespace dummy_hmi_commands_test
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc
new file mode 100644
index 0000000000..3c8a780128
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc
@@ -0,0 +1,135 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/command_request_test.h"
+
+#include <stdint.h>
+#include <string>
+#include <vector>
+#include "gtest/gtest.h"
+
+#include "mobile/get_app_service_data_request.h"
+#include "mobile/get_app_service_data_request_to_mobile.h"
+#include "mobile/get_app_service_data_response.h"
+#include "mobile/get_app_service_data_response_from_mobile.h"
+#include "mobile/on_app_service_data_notification.h"
+#include "mobile/on_app_service_data_notification_from_mobile.h"
+#include "mobile/perform_app_service_interaction_request.h"
+#include "mobile/perform_app_service_interaction_request_to_mobile.h"
+#include "mobile/perform_app_service_interaction_response.h"
+#include "mobile/perform_app_service_interaction_response_from_mobile.h"
+#include "mobile/publish_app_service_request.h"
+#include "mobile/publish_app_service_response.h"
+
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "test/application_manager/mock_application_manager_settings.h"
+#include "application_manager/mock_event_dispatcher.h"
+
+namespace am = application_manager;
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace dummy_mobile_commands_test {
+
+namespace commands = app_service_rpc_plugin::commands;
+using ::testing::_;
+using ::testing::NotNull;
+using ::testing::Types;
+using am::commands::MessageSharedPtr;
+using ::test::components::event_engine_test::MockEventDispatcher;
+using ::test::components::application_manager_test::MockApplicationManager;
+using ::test::components::application_manager_test::
+ MockApplicationManagerSettings;
+using ::application_manager::ApplicationSharedPtr;
+using ::test::components::application_manager_test::MockApplication;
+
+namespace {
+const std::string kEmptyString_ = "";
+} // namespace
+
+template <class Command>
+class MobileCommandsTest : public components::commands_test::CommandRequestTest<
+ CommandsTestMocks::kIsNice> {
+ public:
+ typedef Command CommandType;
+
+ void InitCommand(const uint32_t& timeout) OVERRIDE {
+ EXPECT_CALL(app_mngr_settings_, default_timeout())
+ .WillOnce(ReturnRef(timeout));
+ ON_CALL(app_mngr_, event_dispatcher())
+ .WillByDefault(ReturnRef(event_dispatcher_));
+ ON_CALL(app_mngr_, get_settings())
+ .WillByDefault(ReturnRef(app_mngr_settings_));
+ ON_CALL(app_mngr_settings_, app_icons_folder())
+ .WillByDefault(ReturnRef(kEmptyString_));
+ }
+};
+
+template <class Command>
+class MobileCommandsTestFirst : public MobileCommandsTest<Command> {
+ public:
+ using typename MobileCommandsTest<Command>::CommandType;
+};
+
+/* macro TYPED_TEST_CASE takes max 50 args. That is why there are few
+ * TYPED_TEST_CASE for HMI and mobile commands
+ */
+
+typedef Types<commands::GetAppServiceDataRequest,
+ commands::GetAppServiceDataRequestToMobile,
+ commands::GetAppServiceDataResponse,
+ commands::GetAppServiceDataResponseFromMobile,
+ commands::OnAppServiceDataNotification,
+ commands::OnAppServiceDataNotificationFromMobile,
+ commands::PerformAppServiceInteractionRequest,
+ commands::PerformAppServiceInteractionRequestToMobile,
+ commands::PerformAppServiceInteractionResponse,
+ commands::PerformAppServiceInteractionResponseFromMobile,
+ commands::PublishAppServiceRequest,
+ commands::PublishAppServiceResponse> MobileCommandsListFirst;
+
+TYPED_TEST_CASE(MobileCommandsTestFirst, MobileCommandsListFirst);
+
+TYPED_TEST(MobileCommandsTestFirst, CtorAndDtorCall) {
+ std::shared_ptr<typename TestFixture::CommandType> command =
+ this->template CreateCommand<typename TestFixture::CommandType>();
+ EXPECT_NE(command.use_count(), 0);
+}
+
+} // namespace dummy_mobile_commands_test
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_response.h
index 90160d9953..3a97ebdfb5 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_response.h
@@ -36,7 +36,7 @@
#include "application_manager/commands/response_from_hmi.h"
#include "utils/macro.h"
-#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_manager.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_time_ready_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_time_ready_notification.h
index 0beba8dc6b..7cd8410d8e 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_time_ready_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_time_ready_notification.h
@@ -34,7 +34,7 @@
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SYSTEM_TIME_READY_NOTIFICATION_H_
#include "application_manager/commands/notification_from_hmi.h"
-#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_manager.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_bc_system_capability_updated_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_bc_system_capability_updated_notification.cc
index 73ec1137a8..0677c97db8 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_bc_system_capability_updated_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_bc_system_capability_updated_notification.cc
@@ -31,6 +31,8 @@
*/
#include "sdl_rpc_plugin/commands/hmi/on_bc_system_capability_updated_notification.h"
+
+#include "application_manager/app_service_manager.h"
#include "application_manager/application_impl.h"
#include "application_manager/message_helper.h"
#include "application_manager/rpc_service.h"
@@ -120,7 +122,7 @@ void OnBCSystemCapabilityUpdatedNotification::Run() {
break;
case hmi_apis::Common_SystemCapabilityType::APP_SERVICES: {
auto all_services =
- application_manager_.GetAppServiceManager().GetAllServices();
+ application_manager_.GetAppServiceManager().GetAllServiceRecords();
auto app_service_caps =
MessageHelper::CreateAppServiceCapabilities(all_services);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_file_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_file_request.cc
index 2b3611fece..a582670426 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_file_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_file_request.cc
@@ -31,11 +31,12 @@
*/
#include "sdl_rpc_plugin/commands/mobile/get_file_request.h"
+
+#include "application_manager/app_service_manager.h"
#include "application_manager/application_impl.h"
#include "application_manager/rpc_service.h"
#include "interfaces/MOBILE_API.h"
#include "application_manager/message_helper.h"
-#include "application_manager/app_service_manager.h"
#include "utils/file_system.h"
#include <boost/crc.hpp>
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_request.cc
index 63a4416139..2a25928b97 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_request.cc
@@ -31,7 +31,9 @@
*/
#include "sdl_rpc_plugin/commands/mobile/get_system_capability_request.h"
+
#include "sdl_rpc_plugin/extensions/system_capability_app_extension.h"
+#include "application_manager/app_service_manager.h"
#include "application_manager/message_helper.h"
#include <set>
@@ -143,7 +145,7 @@ void GetSystemCapabilityRequest::Run() {
break;
case mobile_apis::SystemCapabilityType::APP_SERVICES: {
auto all_services =
- application_manager_.GetAppServiceManager().GetAllServices();
+ application_manager_.GetAppServiceManager().GetAllServiceRecords();
response_params
[strings::system_capability][strings::app_services_capabilities] =
MessageHelper::CreateAppServiceCapabilities(all_services);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_capability_updated_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_capability_updated_notification.cc
index b5e3a73ee4..a8544ae643 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_capability_updated_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_capability_updated_notification.cc
@@ -1,4 +1,6 @@
#include "sdl_rpc_plugin/commands/mobile/on_system_capability_updated_notification.h"
+
+#include "application_manager/app_service_manager.h"
#include "application_manager/application_manager.h"
#include "application_manager/helpers/application_helper.h"
#include "application_manager/message_helper.h"
@@ -86,7 +88,7 @@ void OnSystemCapabilityUpdatedNotification::Run() {
break;
case mobile_apis::SystemCapabilityType::APP_SERVICES: {
auto all_services =
- application_manager_.GetAppServiceManager().GetAllServices();
+ application_manager_.GetAppServiceManager().GetAllServiceRecords();
auto app_service_caps =
MessageHelper::CreateAppServiceCapabilities(all_services);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/hmi_command_factory.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/hmi_command_factory.cc
index 3cfe4d7118..fb809e8834 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/hmi_command_factory.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/hmi_command_factory.cc
@@ -248,6 +248,8 @@
namespace sdl_rpc_plugin {
using namespace application_manager;
+CREATE_LOGGERPTR_GLOBAL(logger_, "HMICommandFactory")
+
HMICommandFactory::HMICommandFactory(
ApplicationManager& application_manager,
rpc_service::RPCService& rpc_service,
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc
index a6497ca6e1..874d27b4b0 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc
@@ -223,6 +223,8 @@
#include "hmi/on_tts_reset_timeout_notification.h"
#include "hmi/dial_number_request.h"
#include "hmi/dial_number_response.h"
+#include "hmi/bc_get_file_path_request.h"
+#include "hmi/bc_get_file_path_response.h"
#include "application_manager/commands/commands_test.h"
#include "application_manager/mock_application.h"
@@ -496,7 +498,9 @@ typedef Types<commands::hmi::OnButtonEventNotification,
typedef Types<commands::AllowAllAppsRequest,
commands::AllowAllAppsResponse,
commands::AllowAppRequest,
- commands::AllowAppResponse> HMICommandsListFifth;
+ commands::AllowAppResponse,
+ commands::BCGetFilePathRequest,
+ commands::BCGetFilePathResponse> HMICommandsListFifth;
TYPED_TEST_CASE(HMICommandsTestFirst, HMICommandsListFirst);
TYPED_TEST_CASE(HMICommandsTestSecond, HMICommandsListSecond);
@@ -507,30 +511,30 @@ TYPED_TEST_CASE(HMICommandsTestFifth, HMICommandsListFifth);
TYPED_TEST(HMICommandsTestFirst, CtorAndDtorCall) {
std::shared_ptr<typename TestFixture::CommandType> command =
this->template CreateCommand<typename TestFixture::CommandType>();
- UNUSED(command);
+ EXPECT_NE(command.use_count(), 0);
}
TYPED_TEST(HMICommandsTestSecond, CtorAndDtorCall) {
std::shared_ptr<typename TestFixture::CommandType> command =
this->template CreateCommand<typename TestFixture::CommandType>();
- UNUSED(command);
+ EXPECT_NE(command.use_count(), 0);
}
TYPED_TEST(HMICommandsTestThird, CtorAndDtorCall) {
std::shared_ptr<typename TestFixture::CommandType> command =
this->template CreateCommand<typename TestFixture::CommandType>();
- UNUSED(command);
+ EXPECT_NE(command.use_count(), 0);
}
TYPED_TEST(HMICommandsTestFourth, CtorAndDtorCall) {
std::shared_ptr<typename TestFixture::CommandType> command =
this->template CreateCommand<typename TestFixture::CommandType>();
- UNUSED(command);
+ EXPECT_NE(command.use_count(), 0);
}
TYPED_TEST(HMICommandsTestFifth, CtorAndDtorCall) {
std::shared_ptr<typename TestFixture::CommandType> command =
this->template CreateCommand<typename TestFixture::CommandType>();
- UNUSED(command);
+ EXPECT_NE(command.use_count(), 0);
}
} // namespace dummy_hmi_commands_test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_request_test.cc
index a90c0c70fc..917de81fb3 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_request_test.cc
@@ -140,6 +140,8 @@ TEST_F(SDLActivateAppRequestTest, Run_ActivateApp_SUCCESS) {
std::shared_ptr<SDLActivateAppRequest> command(
CreateCommand<SDLActivateAppRequest>(msg));
+ EXPECT_CALL(app_mngr_, WaitingApplicationByID(kAppID))
+ .WillOnce(Return(ApplicationSharedPtr()));
EXPECT_CALL(app_mngr_, state_controller())
.WillOnce(ReturnRef(mock_state_controller_));
EXPECT_CALL(mock_state_controller_,
@@ -446,8 +448,10 @@ TEST_F(SDLActivateAppRequestTest, WaitingCloudApplication_ConnectDevice) {
EXPECT_CALL(*mock_app, IsRegistered()).WillOnce(Return(false));
EXPECT_CALL(*mock_app, is_cloud_app()).WillOnce(Return(true));
+#ifndef EXTERNAL_PROPRIETARY_MODE
EXPECT_CALL(app_mngr_, application(kAppID))
.WillOnce(Return(ApplicationSharedPtr()));
+#endif
EXPECT_CALL(app_mngr_, WaitingApplicationByID(kAppID))
.WillOnce(Return(mock_app));
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc
index 8589cbb6be..9c20143c39 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc
@@ -62,6 +62,8 @@
#include "mobile/end_audio_pass_thru_request.h"
#include "mobile/end_audio_pass_thru_response.h"
#include "mobile/generic_response.h"
+#include "mobile/get_file_request.h"
+#include "mobile/get_file_response.h"
#include "mobile/get_way_points_request.h"
#include "mobile/get_way_points_response.h"
#include "mobile/list_files_request.h"
@@ -78,6 +80,7 @@
#include "mobile/on_keyboard_input_notification.h"
#include "mobile/on_language_change_notification.h"
#include "mobile/on_permissions_change_notification.h"
+#include "mobile/on_system_capability_updated_notification.h"
#include "mobile/on_system_request_notification.h"
#include "mobile/on_tbt_client_state_notification.h"
#include "mobile/on_touch_event_notification.h"
@@ -220,6 +223,8 @@ typedef Types<commands::AddCommandRequest,
commands::EndAudioPassThruRequest,
commands::EndAudioPassThruResponse,
commands::GenericResponse,
+ commands::GetFileRequest,
+ commands::GetFileResponse,
commands::GetWayPointsRequest,
commands::GetWayPointsResponse,
commands::ListFilesRequest,
@@ -236,12 +241,13 @@ typedef Types<commands::AddCommandRequest,
commands::mobile::OnKeyBoardInputNotification,
commands::OnLanguageChangeNotification,
commands::OnPermissionsChangeNotification,
- commands::mobile::OnSystemRequestNotification,
- commands::OnTBTClientStateNotification,
- commands::mobile::OnTouchEventNotification>
+ commands::mobile::OnSystemCapabilityUpdatedNotification>
MobileCommandsListFirst;
-typedef Types<commands::OnWayPointChangeNotification,
+typedef Types<commands::mobile::OnSystemRequestNotification,
+ commands::OnTBTClientStateNotification,
+ commands::mobile::OnTouchEventNotification,
+ commands::OnWayPointChangeNotification,
commands::PerformAudioPassThruRequest,
commands::PerformAudioPassThruResponse,
commands::PerformInteractionRequest,
@@ -277,12 +283,12 @@ typedef Types<commands::OnWayPointChangeNotification,
commands::SubscribeWayPointsRequest,
commands::SubscribeWayPointsResponse,
commands::SystemResponse,
- commands::UnregisterAppInterfaceRequest,
- commands::UnregisterAppInterfaceResponse,
- commands::UnsubscribeButtonRequest,
- commands::UnsubscribeButtonResponse> MobileCommandsListSecond;
+ commands::UnregisterAppInterfaceRequest> MobileCommandsListSecond;
-typedef Types<commands::UnsubscribeWayPointsRequest,
+typedef Types<commands::UnregisterAppInterfaceResponse,
+ commands::UnsubscribeButtonRequest,
+ commands::UnsubscribeButtonResponse,
+ commands::UnsubscribeWayPointsRequest,
commands::UnsubscribeWayPointsResponse,
commands::UpdateTurnListRequest,
commands::UpdateTurnListResponse> MobileCommandsListThird;
@@ -294,18 +300,18 @@ TYPED_TEST_CASE(MobileCommandsTestThird, MobileCommandsListThird);
TYPED_TEST(MobileCommandsTestFirst, CtorAndDtorCall) {
std::shared_ptr<typename TestFixture::CommandType> command =
this->template CreateCommand<typename TestFixture::CommandType>();
- UNUSED(command);
+ EXPECT_NE(command.use_count(), 0);
}
TYPED_TEST(MobileCommandsTestSecond, CtorAndDtorCall) {
std::shared_ptr<typename TestFixture::CommandType> command =
this->template CreateCommand<typename TestFixture::CommandType>();
- UNUSED(command);
+ EXPECT_NE(command.use_count(), 0);
}
TYPED_TEST(MobileCommandsTestThird, CtorAndDtorCall) {
std::shared_ptr<typename TestFixture::CommandType> command =
this->template CreateCommand<typename TestFixture::CommandType>();
- UNUSED(command);
+ EXPECT_NE(command.use_count(), 0);
}
} // namespace dummy_mobile_commands_test