diff options
Diffstat (limited to 'src/components/include')
15 files changed, 96 insertions, 26 deletions
diff --git a/src/components/include/application_manager/application_manager.h b/src/components/include/application_manager/application_manager.h index 1e17974da4..e4a0417e40 100644 --- a/src/components/include/application_manager/application_manager.h +++ b/src/components/include/application_manager/application_manager.h @@ -38,7 +38,6 @@ #include <string> #include <vector> #include "application_manager/application.h" -#include "application_manager/command_factory.h" #include "application_manager/commands/command.h" #include "connection_handler/connection_handler.h" #include "utils/data_accessor.h" @@ -46,7 +45,6 @@ #include "application_manager/application_manager_settings.h" #include "application_manager/hmi_interfaces.h" #include "application_manager/plugin_manager/rpc_plugin_manager.h" -#include "application_manager/policies/policy_handler_interface.h" #include "application_manager/state_controller.h" #include "policy/policy_types.h" #include "telemetry_monitor/telemetry_observable.h" @@ -76,6 +74,10 @@ namespace resumption { class ResumeCtrl; } +namespace policy { +class PolicyHandlerInterface; +} + namespace application_manager { namespace event_engine { @@ -460,8 +462,7 @@ class ApplicationManager { * @param vehicle_info Enum value of type of vehicle data * @param new value (for integer values currently) of vehicle data */ - virtual void IviInfoUpdated(mobile_apis::VehicleDataType::eType vehicle_info, - int value) = 0; + virtual void IviInfoUpdated(const std::string& vehicle_info, int value) = 0; virtual ApplicationSharedPtr RegisterApplication( const std::shared_ptr<smart_objects::SmartObject>& diff --git a/src/components/include/application_manager/policies/policy_handler_interface.h b/src/components/include/application_manager/policies/policy_handler_interface.h index 6c08dbcb0b..f6ecd050ae 100644 --- a/src/components/include/application_manager/policies/policy_handler_interface.h +++ b/src/components/include/application_manager/policies/policy_handler_interface.h @@ -41,6 +41,7 @@ #include "boost/optional.hpp" #include "application_manager/application.h" +#include "application_manager/policies/custom_vehicle_data_provider.h" #include "application_manager/policies/policy_encryption_flag_getter.h" #include "application_manager/policies/policy_handler_observer.h" #include "interfaces/MOBILE_API.h" @@ -65,7 +66,7 @@ typedef std::shared_ptr<PolicyEncryptionFlagGetterInterface> class PTURetryHandler; -class PolicyHandlerInterface { +class PolicyHandlerInterface : public VehicleDataItemProvider { public: virtual ~PolicyHandlerInterface() {} @@ -123,6 +124,7 @@ class PolicyHandlerInterface { EndpointUrls& out_end_points) = 0; virtual void GetUpdateUrls(const uint32_t service_type, EndpointUrls& out_end_points) = 0; + virtual Json::Value GetPolicyTableData() const = 0; virtual std::string GetLockScreenIconUrl() const = 0; virtual std::string GetIconUrl(const std::string& policy_app_id) const = 0; virtual uint32_t NextRetryTimeout() = 0; @@ -471,12 +473,6 @@ class PolicyHandlerInterface { const std::string& policy_app_id) const = 0; /** - * @brief Gets vehicle information - * @return Structure with vehicle information - */ - virtual const VehicleInfo GetVehicleInfo() const = 0; - - /** * @brief Get a list of enabled cloud applications * @param enabled_apps List filled with the policy app id of each enabled * cloud application diff --git a/src/components/include/application_manager/rpc_handler.h b/src/components/include/application_manager/rpc_handler.h index f42d7deb2f..aafb81b853 100644 --- a/src/components/include/application_manager/rpc_handler.h +++ b/src/components/include/application_manager/rpc_handler.h @@ -38,11 +38,14 @@ #ifdef TELEMETRY_MONITOR #include "application_manager/telemetry_observer.h" +#include "telemetry_monitor/telemetry_observable.h" #endif // TELEMETRY_MONITOR namespace application_manager { namespace rpc_handler { +using ns_smart_device_link::ns_smart_objects::SMember; + class RPCHandler : public hmi_message_handler::HMIMessageObserver, public protocol_handler::ProtocolObserver diff --git a/src/components/include/application_manager/rpc_service.h b/src/components/include/application_manager/rpc_service.h index d052c4ed0a..fb1d280880 100644 --- a/src/components/include/application_manager/rpc_service.h +++ b/src/components/include/application_manager/rpc_service.h @@ -36,11 +36,16 @@ #include "application_manager/commands/command.h" #include "application_manager/message.h" #include "hmi_message_handler/hmi_message_handler.h" +#include "interfaces/HMI_API_schema.h" +#include "interfaces/MOBILE_API_schema.h" #include "protocol_handler/protocol_handler.h" +#include "smart_objects/object_schema_item.h" namespace application_manager { namespace rpc_service { +using ns_smart_device_link::ns_smart_objects::SMember; + class RPCService { public: virtual ~RPCService() {} @@ -81,12 +86,21 @@ class RPCService { * to app services or handled by app services plugin) * @param function_id RPC function id * @param source RPC command source - * @param rpc_passing Reference to bool. Set to true to enable rpc pasing * @return true if App Services can handle RPC */ virtual bool IsAppServiceRPC(int32_t function_id, commands::Command::CommandSource source) = 0; + virtual void UpdateMobileRPCParams( + const mobile_apis::FunctionID::eType& function_id, + const mobile_apis::messageType::eType& message_type, + const std::map<std::string, SMember>& members) = 0; + + virtual void UpdateHMIRPCParams( + const hmi_apis::FunctionID::eType& function_id, + const hmi_apis::messageType::eType& message_type, + const std::map<std::string, SMember>& members) = 0; + /** * @brief set_protocol_handler * @param handler diff --git a/src/components/include/hmi_message_handler/hmi_message_adapter.h b/src/components/include/hmi_message_handler/hmi_message_adapter.h index 704cc619be..af8cddcf32 100644 --- a/src/components/include/hmi_message_handler/hmi_message_adapter.h +++ b/src/components/include/hmi_message_handler/hmi_message_adapter.h @@ -53,7 +53,7 @@ class HMIMessageAdapter : public HMIMessageSender { /** * \brief Interface for subscriptions. * Each class implementing interface should use it according to - * standarts of transport for which it is to be an adapter. + * standards of transport for which it is to be an adapter. * For example, Adapter for MessageBroker will use it to subscribe to * notifications * from HMI. diff --git a/src/components/include/policy/policy_external/policy/policy_manager.h b/src/components/include/policy/policy_external/policy/policy_manager.h index bf0e03b0b8..cce52da626 100644 --- a/src/components/include/policy/policy_external/policy/policy_manager.h +++ b/src/components/include/policy/policy_external/policy/policy_manager.h @@ -568,10 +568,17 @@ class PolicyManager : public usage_statistics::StatisticsManager, const std::string& policy_app_id) const = 0; /** - * @brief Get information about vehicle - * @return vehicle information + * @brief Gets vehicle data items + * @return Structure with vehicle data items */ - virtual const VehicleInfo GetVehicleInfo() const = 0; + virtual const std::vector<policy_table::VehicleDataItem> GetVehicleDataItems() + const = 0; + + /** + * @brief Gets copy of current policy table data + * @return policy_table as json object + */ + virtual Json::Value GetPolicyTableData() const = 0; /** * @brief Get a list of enabled cloud applications diff --git a/src/components/include/policy/policy_regular/policy/policy_manager.h b/src/components/include/policy/policy_regular/policy/policy_manager.h index 27ae18eca8..def0a3660e 100644 --- a/src/components/include/policy/policy_regular/policy/policy_manager.h +++ b/src/components/include/policy/policy_regular/policy/policy_manager.h @@ -544,12 +544,18 @@ class PolicyManager : public usage_statistics::StatisticsManager, const std::string& policy_app_id) const = 0; /** - * @brief Get information about vehicle - * @return vehicle information + * @brief Gets vehicle data items + * @return Structure with vehicle data items */ - virtual const VehicleInfo GetVehicleInfo() const = 0; + virtual const std::vector<policy_table::VehicleDataItem> GetVehicleDataItems() + const = 0; /** + * @brief Gets copy of current policy table data + * @return policy_table as json object + */ + virtual Json::Value GetPolicyTableData() const = 0; + /** * @brief Get a list of enabled cloud applications * @param enabled_apps List filled with the policy app id of each enabled * cloud application 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 60ee73c996..c05a082e5b 100644 --- a/src/components/include/test/application_manager/mock_application_manager.h +++ b/src/components/include/test/application_manager/mock_application_manager.h @@ -194,8 +194,7 @@ class MockApplicationManager : public application_manager::ApplicationManager { MOCK_METHOD1(SetIconFileFromSystemRequest, void(const std::string policy_id)); MOCK_CONST_METHOD0(IsHMICooperating, bool()); MOCK_METHOD2(IviInfoUpdated, - void(mobile_apis::VehicleDataType::eType vehicle_info, - int value)); + void(const std::string& vehicle_info, int value)); MOCK_METHOD1(RegisterApplication, application_manager::ApplicationSharedPtr( const std::shared_ptr<smart_objects::SmartObject>& diff --git a/src/components/include/test/application_manager/mock_rpc_service.h b/src/components/include/test/application_manager/mock_rpc_service.h index fbdc451265..bdbd3d17c7 100644 --- a/src/components/include/test/application_manager/mock_rpc_service.h +++ b/src/components/include/test/application_manager/mock_rpc_service.h @@ -3,11 +3,14 @@ #include "application_manager/rpc_service.h" #include "gmock/gmock.h" +#include "smart_objects/object_schema_item.h" namespace test { namespace components { namespace application_manager_test { +using ns_smart_device_link::ns_smart_objects::SMember; + class MockRPCService : public application_manager::rpc_service::RPCService { public: MOCK_METHOD2( @@ -31,6 +34,15 @@ class MockRPCService : public application_manager::rpc_service::RPCService { IsAppServiceRPC, bool(int32_t function_id, application_manager::commands::Command::CommandSource source)); + MOCK_METHOD3(UpdateMobileRPCParams, + void(const mobile_apis::FunctionID::eType& function_id, + const mobile_apis::messageType::eType& message_type, + const std::map<std::string, SMember>& members)); + + MOCK_METHOD3(UpdateHMIRPCParams, + void(const hmi_apis::FunctionID::eType& function_id, + const hmi_apis::messageType::eType& message_type, + const std::map<std::string, SMember>& members)); }; } // namespace application_manager_test } // namespace components diff --git a/src/components/include/test/application_manager/policies/mock_custom_vehicle_data_provider.h b/src/components/include/test/application_manager/policies/mock_custom_vehicle_data_provider.h new file mode 100644 index 0000000000..b6533521ed --- /dev/null +++ b/src/components/include/test/application_manager/policies/mock_custom_vehicle_data_provider.h @@ -0,0 +1,21 @@ +#ifndef MOCK_CUSTOM_VEHICLE_DATA_MANAGER_H +#define MOCK_CUSTOM_VEHICLE_DATA_MANAGER_H + +#include "application_manager/policies/custom_vehicle_data_provider.h" +#include "gmock/gmock.h" + +namespace test { +namespace components { +namespace policy_test { + +class MockCustomVehicleDataProvider : public policy::VehicleDataItemProvider { + public: + MOCK_CONST_METHOD0( + GetVehicleDataItems, + const std::vector<rpc::policy_table_interface_base::VehicleDataItem>()); +}; + +} // namespace policy_test +} // namespace components +} // namespace test +#endif // MOCK_CUSTOM_VEHICLE_DATA_MANAGER_H diff --git a/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h b/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h index defdad38f7..3b6a4af54d 100644 --- a/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h +++ b/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h @@ -69,6 +69,10 @@ class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface { void(const std::string& device_id, const std::string& policy_app_id, const policy::Permissions& permissions)); + MOCK_CONST_METHOD0(GetPolicyTableData, Json::Value()); + MOCK_CONST_METHOD0( + GetVehicleDataItems, + const std::vector<rpc::policy_table_interface_base::VehicleDataItem>()); #ifdef EXTERNAL_PROPRIETARY_MODE MOCK_METHOD3(OnSnapshotCreated, @@ -234,7 +238,6 @@ class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface { const std::vector<std::string>( const transport_manager::DeviceHandle& device_handle, const std::string& policy_app_id)); - MOCK_CONST_METHOD0(GetVehicleInfo, const policy::VehicleInfo()); MOCK_CONST_METHOD1(GetEnabledCloudApps, void(std::vector<std::string>& enabled_apps)); MOCK_CONST_METHOD1(CheckCloudAppEnabled, diff --git a/src/components/include/test/policy/policy_external/policy/mock_cache_manager.h b/src/components/include/test/policy/policy_external/policy/mock_cache_manager.h index 938be4eb85..35b01d20c1 100644 --- a/src/components/include/test/policy/policy_external/policy/mock_cache_manager.h +++ b/src/components/include/test/policy/policy_external/policy/mock_cache_manager.h @@ -76,7 +76,9 @@ class MockCacheManagerInterface : public ::policy::CacheManagerInterface { MOCK_METHOD0(TimeoutResponse, int()); MOCK_METHOD1(SecondsBetweenRetries, bool(std::vector<int>& seconds)); MOCK_CONST_METHOD1(IsDeviceConsentCached, bool(const std::string& device_id)); - MOCK_CONST_METHOD0(GetVehicleInfo, const VehicleInfo()); + MOCK_CONST_METHOD0(GetPolicyTableData, Json::Value()); + MOCK_CONST_METHOD0(GetVehicleDataItems, + const std::vector<policy_table::VehicleDataItem>()); MOCK_CONST_METHOD1(GetEnabledCloudApps, void(std::vector<std::string>& enabled_apps)); MOCK_CONST_METHOD7(GetCloudAppParameters, diff --git a/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h b/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h index cfe5844757..455954795f 100644 --- a/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h +++ b/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h @@ -218,7 +218,9 @@ class MockPolicyManager : public PolicyManager { const std::vector<std::string>( const transport_manager::DeviceHandle& device_handle, const std::string policy_app_id)); - MOCK_CONST_METHOD0(GetVehicleInfo, const policy::VehicleInfo()); + MOCK_CONST_METHOD0(GetPolicyTableData, Json::Value()); + MOCK_CONST_METHOD0(GetVehicleDataItems, + const std::vector<policy_table::VehicleDataItem>()); MOCK_CONST_METHOD1(GetEnabledCloudApps, void(std::vector<std::string>& enabled_apps)); MOCK_CONST_METHOD7(GetCloudAppParameters, diff --git a/src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h b/src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h index 194445b8b6..d3da4d74c3 100644 --- a/src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h +++ b/src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h @@ -62,7 +62,9 @@ class MockCacheManagerInterface : public CacheManagerInterface { MOCK_METHOD0(ResetIgnitionCycles, void()); MOCK_METHOD0(TimeoutResponse, int()); MOCK_METHOD1(SecondsBetweenRetries, bool(std::vector<int>& seconds)); - MOCK_CONST_METHOD0(GetVehicleInfo, const VehicleInfo()); + MOCK_CONST_METHOD0(GetPolicyTableData, Json::Value()); + MOCK_CONST_METHOD0(GetVehicleDataItems, + const std::vector<policy_table::VehicleDataItem>()); MOCK_CONST_METHOD1(GetEnabledCloudApps, void(std::vector<std::string>& enabled_apps)); MOCK_CONST_METHOD7(GetCloudAppParameters, diff --git a/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h b/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h index d23674c060..a446128cad 100644 --- a/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h +++ b/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h @@ -213,7 +213,9 @@ class MockPolicyManager : public PolicyManager { MOCK_CONST_METHOD1( GetAppRequestTypes, const std::vector<std::string>(const std::string policy_app_id)); - MOCK_CONST_METHOD0(GetVehicleInfo, const policy::VehicleInfo()); + MOCK_CONST_METHOD0(GetPolicyTableData, Json::Value()); + MOCK_CONST_METHOD0(GetVehicleDataItems, + const std::vector<policy_table::VehicleDataItem>()); MOCK_CONST_METHOD1(GetEnabledCloudApps, void(std::vector<std::string>& enabled_apps)); MOCK_CONST_METHOD7(GetCloudAppParameters, |