From 5f3cf62d06049b9ee64a75d205581914c4c90929 Mon Sep 17 00:00:00 2001 From: jacobkeeler Date: Thu, 15 Nov 2018 15:54:08 -0500 Subject: Address review comments --- .../application_manager/policies/policy_handler.h | 21 +++++++------- .../src/policies/policy_handler.cc | 33 +++++++++++++--------- .../policies/policy_handler_interface.h | 9 +++--- .../policy/policy_external/policy/policy_manager.h | 9 +++--- .../policy/policy_regular/policy/policy_manager.h | 9 +++--- .../policies/mock_policy_handler_interface.h | 15 +++++----- .../policy_external/policy/mock_cache_manager.h | 15 +++++----- .../policy_external/policy/mock_policy_manager.h | 15 +++++----- .../policy_regular/policy/mock_cache_manager.h | 15 +++++----- .../policy_regular/policy/mock_policy_manager.h | 15 +++++----- .../policy_external/include/policy/cache_manager.h | 20 ++++++------- .../include/policy/cache_manager_interface.h | 9 +++--- .../include/policy/policy_manager_impl.h | 20 ++++++------- .../policy/policy_external/src/cache_manager.cc | 12 ++++---- .../policy_external/src/policy_manager_impl.cc | 16 ++++++----- .../policy_regular/include/policy/cache_manager.h | 20 ++++++------- .../include/policy/cache_manager_interface.h | 9 +++--- .../include/policy/policy_manager_impl.h | 20 ++++++------- .../policy/policy_regular/src/cache_manager.cc | 6 ++-- .../policy_regular/src/policy_manager_impl.cc | 16 ++++++----- 20 files changed, 161 insertions(+), 143 deletions(-) diff --git a/src/components/application_manager/include/application_manager/policies/policy_handler.h b/src/components/application_manager/include/application_manager/policies/policy_handler.h index a612c263ca..8ee5ff64f6 100644 --- a/src/components/application_manager/include/application_manager/policies/policy_handler.h +++ b/src/components/application_manager/include/application_manager/policies/policy_handler.h @@ -419,26 +419,25 @@ class PolicyHandler : public PolicyHandlerInterface, * @brief Get cloud app policy information, all fields that aren't set for a * given app will be filled with empty strings * @param policy_app_id Unique application id + * @param enabled Whether or not the app is enabled * @param endpoint Filled with the endpoint used to connect to the cloud * application * @param certificate Filled with the certificate used to for creating a - * secure - * connection to the cloud application + * secure connection to the cloud application * @param auth_token Filled with the token used for authentication when * reconnecting to the cloud app * @param cloud_transport_type Filled with the transport type used by the * cloud application (ex. "WSS") - * @param cloud_transport_type Filled with the hybrid app preference for the + * @param hybrid_app_preference Filled with the hybrid app preference for the * cloud application set by the user - * @return true if the cloud app is enabled, false otherwise */ - const bool GetCloudAppParameters( - const std::string& policy_app_id, - std::string& endpoint, - std::string& certificate, - std::string& auth_token, - std::string& cloud_transport_type, - std::string& hybrid_app_preference) const OVERRIDE; + void GetCloudAppParameters(const std::string& policy_app_id, + bool& enabled, + std::string& endpoint, + std::string& certificate, + std::string& auth_token, + std::string& cloud_transport_type, + std::string& hybrid_app_preference) const OVERRIDE; /** * @brief Callback for when a SetCloudAppProperties message is received from a diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc index cc62d9f6f8..505f29e13b 100644 --- a/src/components/application_manager/src/policies/policy_handler.cc +++ b/src/components/application_manager/src/policies/policy_handler.cc @@ -1851,36 +1851,41 @@ void PolicyHandler::GetEnabledCloudApps( policy_manager_->GetEnabledCloudApps(enabled_apps); } -const bool PolicyHandler::GetCloudAppParameters( +void PolicyHandler::GetCloudAppParameters( const std::string& policy_app_id, + bool& enabled, std::string& endpoint, std::string& certificate, std::string& auth_token, std::string& cloud_transport_type, std::string& hybrid_app_preference) const { - POLICY_LIB_CHECK(false); - return policy_manager_->GetCloudAppParameters(policy_app_id, - endpoint, - certificate, - auth_token, - cloud_transport_type, - hybrid_app_preference); + POLICY_LIB_CHECK_VOID(); + policy_manager_->GetCloudAppParameters(policy_app_id, + enabled, + endpoint, + certificate, + auth_token, + cloud_transport_type, + hybrid_app_preference); } const bool PolicyHandler::CheckCloudAppEnabled( const std::string& policy_app_id) const { POLICY_LIB_CHECK(false); + bool enabled = false; std::string endpoint; std::string auth_token; std::string certificate; std::string cloud_transport_type; std::string hybrid_app_preference; - return policy_manager_->GetCloudAppParameters(policy_app_id, - endpoint, - certificate, - auth_token, - cloud_transport_type, - hybrid_app_preference); + policy_manager_->GetCloudAppParameters(policy_app_id, + enabled, + endpoint, + certificate, + auth_token, + cloud_transport_type, + hybrid_app_preference); + return enabled; } void PolicyHandler::OnSetCloudAppProperties( 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 ddeb1da8f7..8c8a12ced3 100644 --- a/src/components/include/application_manager/policies/policy_handler_interface.h +++ b/src/components/include/application_manager/policies/policy_handler_interface.h @@ -459,7 +459,8 @@ class PolicyHandlerInterface { * @brief Get cloud app policy information, all fields that aren't set for a * given app will be filled with empty strings * @param policy_app_id Unique application id - * @param endpoint Filled the endpoint used to connect to the cloud + * @param enabled Whether or not the app is enabled + * @param endpoint Filled with the endpoint used to connect to the cloud * application * @param certificate Filled with the certificate used to for creating a * secure connection to the cloud application @@ -467,12 +468,12 @@ class PolicyHandlerInterface { * reconnecting to the cloud app * @param cloud_transport_type Filled with the transport type used by the * cloud application (ex. "WSS") - * @param cloud_transport_type Filled with the hybrid app preference for the + * @param hybrid_app_preference Filled with the hybrid app preference for the * cloud application set by the user - * @return true if the cloud app is enabled, false otherwise */ - virtual const bool GetCloudAppParameters( + virtual void GetCloudAppParameters( const std::string& policy_app_id, + bool& enabled, std::string& endpoint, std::string& certificate, std::string& auth_token, 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 b0fac8eae9..37c8a902f1 100644 --- a/src/components/include/policy/policy_external/policy/policy_manager.h +++ b/src/components/include/policy/policy_external/policy/policy_manager.h @@ -534,7 +534,8 @@ class PolicyManager : public usage_statistics::StatisticsManager { * @brief Get cloud app policy information, all fields that aren't set for a * given app will be filled with empty strings * @param policy_app_id Unique application id - * @param endpoint Filled the endpoint used to connect to the cloud + * @param enabled Whether or not the app is enabled + * @param endpoint Filled with the endpoint used to connect to the cloud * application * @param certificate Filled with the certificate used to for creating a * secure connection to the cloud application @@ -542,12 +543,12 @@ class PolicyManager : public usage_statistics::StatisticsManager { * reconnecting to the cloud app * @param cloud_transport_type Filled with the transport type used by the * cloud application (ex. "WSS") - * @param cloud_transport_type Filled with the hybrid app preference for the + * @param hybrid_app_preference Filled with the hybrid app preference for the * cloud application set by the user - * @return true if the cloud app is enabled, false otherwise */ - virtual const bool GetCloudAppParameters( + virtual void GetCloudAppParameters( const std::string& policy_app_id, + bool& enabled, std::string& endpoint, std::string& certificate, std::string& auth_token, 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 1f0f520077..d22f52bfed 100644 --- a/src/components/include/policy/policy_regular/policy/policy_manager.h +++ b/src/components/include/policy/policy_regular/policy/policy_manager.h @@ -514,7 +514,8 @@ class PolicyManager : public usage_statistics::StatisticsManager { * @brief Get cloud app policy information, all fields that aren't set for a * given app will be filled with empty strings * @param policy_app_id Unique application id - * @param endpoint Filled the endpoint used to connect to the cloud + * @param enabled Whether or not the app is enabled + * @param endpoint Filled with the endpoint used to connect to the cloud * application * @param certificate Filled with the certificate used to for creating a * secure connection to the cloud application @@ -522,12 +523,12 @@ class PolicyManager : public usage_statistics::StatisticsManager { * reconnecting to the cloud app * @param cloud_transport_type Filled with the transport type used by the * cloud application (ex. "WSS") - * @param cloud_transport_type Filled with the hybrid app preference for the + * @param hybrid_app_preference Filled with the hybrid app preference for the * cloud application set by the user - * @return true if the cloud app is enabled, false otherwise */ - virtual const bool GetCloudAppParameters( + virtual void GetCloudAppParameters( const std::string& policy_app_id, + bool& enabled, std::string& endpoint, std::string& certificate, std::string& auth_token, 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 cea36082c8..02a0d73086 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 @@ -217,13 +217,14 @@ class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface { void(std::vector& enabled_apps)); MOCK_CONST_METHOD1(CheckCloudAppEnabled, const bool(const std::string& policy_app_id)); - MOCK_CONST_METHOD6(GetCloudAppParameters, - const bool(const std::string& policy_app_id, - std::string& endpoint, - std::string& certificate, - std::string& auth_token, - std::string& cloud_transport_type, - std::string& hybrid_app_preference)); + MOCK_CONST_METHOD7(GetCloudAppParameters, + void(const std::string& policy_app_id, + bool& enabled, + std::string& endpoint, + std::string& certificate, + std::string& auth_token, + std::string& cloud_transport_type, + std::string& hybrid_app_preference)); MOCK_METHOD1(OnSetCloudAppProperties, void(const smart_objects::SmartObject& message)); 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 03e0882129..db3f37fb91 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 @@ -78,13 +78,14 @@ class MockCacheManagerInterface : public ::policy::CacheManagerInterface { MOCK_CONST_METHOD0(GetVehicleInfo, const VehicleInfo()); MOCK_CONST_METHOD1(GetEnabledCloudApps, void(std::vector& enabled_apps)); - MOCK_CONST_METHOD6(GetCloudAppParameters, - const bool(const std::string& policy_app_id, - std::string& endpoint, - std::string& certificate, - std::string& auth_token, - std::string& cloud_transport_type, - std::string& hybrid_app_preference)); + MOCK_CONST_METHOD7(GetCloudAppParameters, + void(const std::string& policy_app_id, + bool& enabled, + std::string& endpoint, + std::string& certificate, + std::string& auth_token, + std::string& cloud_transport_type, + std::string& hybrid_app_preference)); MOCK_METHOD2(SetCloudAppEnabled, void(const std::string& policy_app_id, const bool enabled)); MOCK_METHOD2(SetAppAuthToken, 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 70dab8e99a..1eabb78019 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 @@ -186,13 +186,14 @@ class MockPolicyManager : public PolicyManager { MOCK_CONST_METHOD0(GetVehicleInfo, const policy::VehicleInfo()); MOCK_CONST_METHOD1(GetEnabledCloudApps, void(std::vector& enabled_apps)); - MOCK_CONST_METHOD6(GetCloudAppParameters, - const bool(const std::string& policy_app_id, - std::string& endpoint, - std::string& certificate, - std::string& auth_token, - std::string& cloud_transport_type, - std::string& hybrid_app_preference)); + MOCK_CONST_METHOD7(GetCloudAppParameters, + void(const std::string& policy_app_id, + bool& enabled, + std::string& endpoint, + std::string& certificate, + std::string& auth_token, + std::string& cloud_transport_type, + std::string& hybrid_app_preference)); MOCK_METHOD2(SetCloudAppEnabled, void(const std::string& policy_app_id, const bool enabled)); MOCK_METHOD2(SetAppAuthToken, 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 7ac94d278d..3d8dc4116a 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 @@ -65,13 +65,14 @@ class MockCacheManagerInterface : public CacheManagerInterface { MOCK_CONST_METHOD0(GetVehicleInfo, const VehicleInfo()); MOCK_CONST_METHOD1(GetEnabledCloudApps, void(std::vector& enabled_apps)); - MOCK_CONST_METHOD6(GetCloudAppParameters, - const bool(const std::string& policy_app_id, - std::string& endpoint, - std::string& certificate, - std::string& auth_token, - std::string& cloud_transport_type, - std::string& hybrid_app_preference)); + MOCK_CONST_METHOD7(GetCloudAppParameters, + void(const std::string& policy_app_id, + bool& enabled, + std::string& endpoint, + std::string& certificate, + std::string& auth_token, + std::string& cloud_transport_type, + std::string& hybrid_app_preference)); MOCK_METHOD2(SetCloudAppEnabled, void(const std::string& policy_app_id, const bool enabled)); MOCK_METHOD2(SetAppAuthToken, 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 7441701a34..a28ea32108 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 @@ -183,13 +183,14 @@ class MockPolicyManager : public PolicyManager { MOCK_CONST_METHOD0(GetVehicleInfo, const policy::VehicleInfo()); MOCK_CONST_METHOD1(GetEnabledCloudApps, void(std::vector& enabled_apps)); - MOCK_CONST_METHOD6(GetCloudAppParameters, - const bool(const std::string& policy_app_id, - std::string& endpoint, - std::string& certificate, - std::string& auth_token, - std::string& cloud_transport_type, - std::string& hybrid_app_preference)); + MOCK_CONST_METHOD7(GetCloudAppParameters, + void(const std::string& policy_app_id, + bool& enabled, + std::string& endpoint, + std::string& certificate, + std::string& auth_token, + std::string& cloud_transport_type, + std::string& hybrid_app_preference)); MOCK_METHOD2(SetCloudAppEnabled, void(const std::string& policy_app_id, const bool enabled)); MOCK_METHOD2(SetAppAuthToken, diff --git a/src/components/policy/policy_external/include/policy/cache_manager.h b/src/components/policy/policy_external/include/policy/cache_manager.h index 7660eb2df9..98f279b345 100644 --- a/src/components/policy/policy_external/include/policy/cache_manager.h +++ b/src/components/policy/policy_external/include/policy/cache_manager.h @@ -170,7 +170,8 @@ class CacheManager : public CacheManagerInterface { * @brief Get cloud app policy information, all fields that aren't set for a * given app will be filled with empty strings * @param policy_app_id Unique application id - * @param endpoint Filled the endpoint used to connect to the cloud + * @param enabled Whether or not the app is enabled + * @param endpoint Filled with the endpoint used to connect to the cloud * application * @param certificate Filled with the certificate used to for creating a * secure connection to the cloud application @@ -178,17 +179,16 @@ class CacheManager : public CacheManagerInterface { * reconnecting to the cloud app * @param cloud_transport_type Filled with the transport type used by the * cloud application (ex. "WSS") - * @param cloud_transport_type Filled with the hybrid app preference for the + * @param hybrid_app_preference Filled with the hybrid app preference for the * cloud application set by the user - * @return true if the cloud app is enabled, false otherwise */ - virtual const bool GetCloudAppParameters( - const std::string& policy_app_id, - std::string& endpoint, - std::string& certificate, - std::string& auth_token, - std::string& cloud_transport_type, - std::string& hybrid_app_preference) const; + virtual void GetCloudAppParameters(const std::string& policy_app_id, + bool& enabled, + std::string& endpoint, + std::string& certificate, + std::string& auth_token, + std::string& cloud_transport_type, + std::string& hybrid_app_preference) const; /** * @brief Enable or disable a cloud application in the HMI diff --git a/src/components/policy/policy_external/include/policy/cache_manager_interface.h b/src/components/policy/policy_external/include/policy/cache_manager_interface.h index 79d6f4e731..2a334876ae 100644 --- a/src/components/policy/policy_external/include/policy/cache_manager_interface.h +++ b/src/components/policy/policy_external/include/policy/cache_manager_interface.h @@ -177,7 +177,8 @@ class CacheManagerInterface { * @brief Get cloud app policy information, all fields that aren't set for a * given app will be filled with empty strings * @param policy_app_id Unique application id - * @param endpoint Filled the endpoint used to connect to the cloud + * @param enabled Whether or not the app is enabled + * @param endpoint Filled with the endpoint used to connect to the cloud * application * @param certificate Filled with the certificate used to for creating a * secure connection to the cloud application @@ -185,12 +186,12 @@ class CacheManagerInterface { * reconnecting to the cloud app * @param cloud_transport_type Filled with the transport type used by the * cloud application (ex. "WSS") - * @param cloud_transport_type Filled with the hybrid app preference for the + * @param hybrid_app_preference Filled with the hybrid app preference for the * cloud application set by the user - * @return true if the cloud app is enabled, false otherwise */ - virtual const bool GetCloudAppParameters( + virtual void GetCloudAppParameters( const std::string& policy_app_id, + bool& enabled, std::string& endpoint, std::string& certificate, std::string& auth_token, diff --git a/src/components/policy/policy_external/include/policy/policy_manager_impl.h b/src/components/policy/policy_external/include/policy/policy_manager_impl.h index 778892df13..6d4cbbf773 100644 --- a/src/components/policy/policy_external/include/policy/policy_manager_impl.h +++ b/src/components/policy/policy_external/include/policy/policy_manager_impl.h @@ -582,7 +582,8 @@ class PolicyManagerImpl : public PolicyManager { * @brief Get cloud app policy information, all fields that aren't set for a * given app will be filled with empty strings * @param policy_app_id Unique application id - * @param endpoint Filled the endpoint used to connect to the cloud + * @param enabled Whether or not the app is enabled + * @param endpoint Filled with the endpoint used to connect to the cloud * application * @param certificate Filled with the certificate used to for creating a * secure connection to the cloud application @@ -590,17 +591,16 @@ class PolicyManagerImpl : public PolicyManager { * reconnecting to the cloud app * @param cloud_transport_type Filled with the transport type used by the * cloud application (ex. "WSS") - * @param cloud_transport_type Filled with the hybrid app preference for the + * @param hybrid_app_preference Filled with the hybrid app preference for the * cloud application set by the user - * @return true if the cloud app is enabled, false otherwise */ - const bool GetCloudAppParameters( - const std::string& policy_app_id, - std::string& endpoint, - std::string& certificate, - std::string& auth_token, - std::string& cloud_transport_type, - std::string& hybrid_app_preference) const OVERRIDE; + void GetCloudAppParameters(const std::string& policy_app_id, + bool& enabled, + std::string& endpoint, + std::string& certificate, + std::string& auth_token, + std::string& cloud_transport_type, + std::string& hybrid_app_preference) const OVERRIDE; /** * @brief Enable or disable a cloud application in the HMI diff --git a/src/components/policy/policy_external/src/cache_manager.cc b/src/components/policy/policy_external/src/cache_manager.cc index 116b315755..dc0838d429 100644 --- a/src/components/policy/policy_external/src/cache_manager.cc +++ b/src/components/policy/policy_external/src/cache_manager.cc @@ -1403,8 +1403,9 @@ void CacheManager::GetEnabledCloudApps( } } -const bool CacheManager::GetCloudAppParameters( +void CacheManager::GetCloudAppParameters( const std::string& policy_app_id, + bool& enabled, std::string& endpoint, std::string& certificate, std::string& auth_token, @@ -1418,21 +1419,20 @@ const bool CacheManager::GetCloudAppParameters( auto app_policy = (*policy_iter).second; endpoint = app_policy.endpoint.is_initialized() ? *app_policy.endpoint : std::string(); - certificate = app_policy.certificate.is_initialized() - ? *app_policy.certificate - : std::string(); auth_token = app_policy.auth_token.is_initialized() ? *app_policy.auth_token : std::string(); cloud_transport_type = app_policy.cloud_transport_type.is_initialized() ? *app_policy.cloud_transport_type : std::string(); + certificate = app_policy.certificate.is_initialized() + ? *app_policy.certificate + : std::string(); hybrid_app_preference = app_policy.hybrid_app_preference.is_initialized() ? EnumToJsonString(*app_policy.hybrid_app_preference) : std::string(); - return app_policy.enabled.is_initialized() && *app_policy.enabled; + enabled = app_policy.enabled.is_initialized() && *app_policy.enabled; } - return false; } void CacheManager::SetCloudAppEnabled(const std::string& policy_app_id, diff --git a/src/components/policy/policy_external/src/policy_manager_impl.cc b/src/components/policy/policy_external/src/policy_manager_impl.cc index 31cc212254..df474268ba 100644 --- a/src/components/policy/policy_external/src/policy_manager_impl.cc +++ b/src/components/policy/policy_external/src/policy_manager_impl.cc @@ -730,19 +730,21 @@ void PolicyManagerImpl::GetEnabledCloudApps( cache_->GetEnabledCloudApps(enabled_apps); } -const bool PolicyManagerImpl::GetCloudAppParameters( +void PolicyManagerImpl::GetCloudAppParameters( const std::string& policy_app_id, + bool& enabled, std::string& endpoint, std::string& certificate, std::string& auth_token, std::string& cloud_transport_type, std::string& hybrid_app_preference) const { - return cache_->GetCloudAppParameters(policy_app_id, - endpoint, - certificate, - auth_token, - cloud_transport_type, - hybrid_app_preference); + cache_->GetCloudAppParameters(policy_app_id, + enabled, + endpoint, + certificate, + auth_token, + cloud_transport_type, + hybrid_app_preference); } void PolicyManagerImpl::SetCloudAppEnabled(const std::string& policy_app_id, diff --git a/src/components/policy/policy_regular/include/policy/cache_manager.h b/src/components/policy/policy_regular/include/policy/cache_manager.h index 39f9cc73cd..a4ae45d604 100644 --- a/src/components/policy/policy_regular/include/policy/cache_manager.h +++ b/src/components/policy/policy_regular/include/policy/cache_manager.h @@ -158,7 +158,8 @@ class CacheManager : public CacheManagerInterface { * @brief Get cloud app policy information, all fields that aren't set for a * given app will be filled with empty strings * @param policy_app_id Unique application id - * @param endpoint Filled the endpoint used to connect to the cloud + * @param enabled Whether or not the app is enabled + * @param endpoint Filled with the endpoint used to connect to the cloud * application * @param certificate Filled with the certificate used to for creating a * secure connection to the cloud application @@ -166,17 +167,16 @@ class CacheManager : public CacheManagerInterface { * reconnecting to the cloud app * @param cloud_transport_type Filled with the transport type used by the * cloud application (ex. "WSS") - * @param cloud_transport_type Filled with the hybrid app preference for the + * @param hybrid_app_preference Filled with the hybrid app preference for the * cloud application set by the user - * @return true if the cloud app is enabled, false otherwise */ - virtual const bool GetCloudAppParameters( - const std::string& policy_app_id, - std::string& endpoint, - std::string& certificate, - std::string& auth_token, - std::string& cloud_transport_type, - std::string& hybrid_app_preference) const; + virtual void GetCloudAppParameters(const std::string& policy_app_id, + bool& enabled, + std::string& endpoint, + std::string& certificate, + std::string& auth_token, + std::string& cloud_transport_type, + std::string& hybrid_app_preference) const; /** * @brief Enable or disable a cloud application in the HMI diff --git a/src/components/policy/policy_regular/include/policy/cache_manager_interface.h b/src/components/policy/policy_regular/include/policy/cache_manager_interface.h index 3b2b10d0bc..f0ee9c2b25 100644 --- a/src/components/policy/policy_regular/include/policy/cache_manager_interface.h +++ b/src/components/policy/policy_regular/include/policy/cache_manager_interface.h @@ -163,7 +163,8 @@ class CacheManagerInterface { * @brief Get cloud app policy information, all fields that aren't set for a * given app will be filled with empty strings * @param policy_app_id Unique application id - * @param endpoint Filled the endpoint used to connect to the cloud + * @param enabled Whether or not the app is enabled + * @param endpoint Filled with the endpoint used to connect to the cloud * application * @param certificate Filled with the certificate used to for creating a * secure connection to the cloud application @@ -171,12 +172,12 @@ class CacheManagerInterface { * reconnecting to the cloud app * @param cloud_transport_type Filled with the transport type used by the * cloud application (ex. "WSS") - * @param cloud_transport_type Filled with the hybrid app preference for the + * @param hybrid_app_preference Filled with the hybrid app preference for the * cloud application set by the user - * @return true if the cloud app is enabled, false otherwise */ - virtual const bool GetCloudAppParameters( + virtual void GetCloudAppParameters( const std::string& policy_app_id, + bool& enabled, std::string& endpoint, std::string& certificate, std::string& auth_token, diff --git a/src/components/policy/policy_regular/include/policy/policy_manager_impl.h b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h index 311ced31d2..0a0c260a96 100644 --- a/src/components/policy/policy_regular/include/policy/policy_manager_impl.h +++ b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h @@ -576,7 +576,8 @@ class PolicyManagerImpl : public PolicyManager { * @brief Get cloud app policy information, all fields that aren't set for a * given app will be filled with empty strings * @param policy_app_id Unique application id - * @param endpoint Filled the endpoint used to connect to the cloud + * @param enabled Whether or not the app is enabled + * @param endpoint Filled with the endpoint used to connect to the cloud * application * @param certificate Filled with the certificate used to for creating a * secure connection to the cloud application @@ -584,17 +585,16 @@ class PolicyManagerImpl : public PolicyManager { * reconnecting to the cloud app * @param cloud_transport_type Filled with the transport type used by the * cloud application (ex. "WSS") - * @param cloud_transport_type Filled with the hybrid app preference for the + * @param hybrid_app_preference Filled with the hybrid app preference for the * cloud application set by the user - * @return true if the cloud app is enabled, false otherwise */ - const bool GetCloudAppParameters( - const std::string& policy_app_id, - std::string& endpoint, - std::string& certificate, - std::string& auth_token, - std::string& cloud_transport_type, - std::string& hybrid_app_preference) const OVERRIDE; + void GetCloudAppParameters(const std::string& policy_app_id, + bool& enabled, + std::string& endpoint, + std::string& certificate, + std::string& auth_token, + std::string& cloud_transport_type, + std::string& hybrid_app_preference) const OVERRIDE; /** * @brief Enable or disable a cloud application in the HMI diff --git a/src/components/policy/policy_regular/src/cache_manager.cc b/src/components/policy/policy_regular/src/cache_manager.cc index 9292c389b9..c4b3d8db53 100644 --- a/src/components/policy/policy_regular/src/cache_manager.cc +++ b/src/components/policy/policy_regular/src/cache_manager.cc @@ -696,8 +696,9 @@ void CacheManager::GetEnabledCloudApps( } } -const bool CacheManager::GetCloudAppParameters( +void CacheManager::GetCloudAppParameters( const std::string& policy_app_id, + bool& enabled, std::string& endpoint, std::string& certificate, std::string& auth_token, @@ -723,9 +724,8 @@ const bool CacheManager::GetCloudAppParameters( app_policy.hybrid_app_preference.is_initialized() ? EnumToJsonString(*app_policy.hybrid_app_preference) : std::string(); - return app_policy.enabled.is_initialized() && *app_policy.enabled; + enabled = app_policy.enabled.is_initialized() && *app_policy.enabled; } - return false; } void CacheManager::SetCloudAppEnabled(const std::string& policy_app_id, diff --git a/src/components/policy/policy_regular/src/policy_manager_impl.cc b/src/components/policy/policy_regular/src/policy_manager_impl.cc index 5aa29fc896..6e635b7f36 100644 --- a/src/components/policy/policy_regular/src/policy_manager_impl.cc +++ b/src/components/policy/policy_regular/src/policy_manager_impl.cc @@ -549,19 +549,21 @@ void PolicyManagerImpl::GetEnabledCloudApps( cache_->GetEnabledCloudApps(enabled_apps); } -const bool PolicyManagerImpl::GetCloudAppParameters( +void PolicyManagerImpl::GetCloudAppParameters( const std::string& policy_app_id, + bool& enabled, std::string& endpoint, std::string& certificate, std::string& auth_token, std::string& cloud_transport_type, std::string& hybrid_app_preference) const { - return cache_->GetCloudAppParameters(policy_app_id, - endpoint, - certificate, - auth_token, - cloud_transport_type, - hybrid_app_preference); + cache_->GetCloudAppParameters(policy_app_id, + enabled, + endpoint, + certificate, + auth_token, + cloud_transport_type, + hybrid_app_preference); } void PolicyManagerImpl::SetCloudAppEnabled(const std::string& policy_app_id, -- cgit v1.2.1 From a43cbaaafd43be09d2d301c8acc32b053794f108 Mon Sep 17 00:00:00 2001 From: ShobhitAd Date: Fri, 16 Nov 2018 12:54:22 -0500 Subject: Implemented InitCloudApp in policy_regular --- .../src/policies/policy_handler.cc | 3 +++ .../policy/policy_regular/policy/policy_manager.h | 7 +++++++ .../policy_regular/include/policy/cache_manager.h | 9 +++++++++ .../include/policy/cache_manager_interface.h | 8 ++++++++ .../include/policy/policy_manager_impl.h | 7 +++++++ .../policy/policy_regular/src/cache_manager.cc | 21 +++++++++++++++++++++ .../policy_regular/src/policy_manager_impl.cc | 4 ++++ 7 files changed, 59 insertions(+) diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc index 505f29e13b..e7af4b972e 100644 --- a/src/components/application_manager/src/policies/policy_handler.cc +++ b/src/components/application_manager/src/policies/policy_handler.cc @@ -1905,6 +1905,9 @@ void PolicyHandler::OnSetCloudAppProperties( return; } std::string policy_app_id(msg_params[strings::app_id].asString()); + + policy_manager_->InitCloudApp(policy_app_id); + if (msg_params.keyExists(strings::enabled)) { policy_manager_->SetCloudAppEnabled(policy_app_id, msg_params[strings::enabled].asBool()); 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 d22f52bfed..b2d48585f4 100644 --- a/src/components/include/policy/policy_regular/policy/policy_manager.h +++ b/src/components/include/policy/policy_regular/policy/policy_manager.h @@ -535,6 +535,13 @@ class PolicyManager : public usage_statistics::StatisticsManager { std::string& cloud_transport_type, std::string& hybrid_app_preference) const = 0; + /** + * @ brief Initialize new cloud app in the policy table + * @ param policy_app_id Application ID + */ + + virtual void InitCloudApp(const std::string& policy_app_id) = 0; + /** * @brief Enable or disable a cloud application in the HMI * @param enabled Cloud app enabled state diff --git a/src/components/policy/policy_regular/include/policy/cache_manager.h b/src/components/policy/policy_regular/include/policy/cache_manager.h index a4ae45d604..0ce35b5beb 100644 --- a/src/components/policy/policy_regular/include/policy/cache_manager.h +++ b/src/components/policy/policy_regular/include/policy/cache_manager.h @@ -178,6 +178,15 @@ class CacheManager : public CacheManagerInterface { std::string& cloud_transport_type, std::string& hybrid_app_preference) const; + /** + * Initializes a new cloud application with default policies + * Then adds cloud specific policies + * @param app_id application id + * @return true if success + */ + virtual void InitCloudApp(const std::string& policy_app_id); + + /** * @brief Enable or disable a cloud application in the HMI * @param enabled Cloud app enabled state diff --git a/src/components/policy/policy_regular/include/policy/cache_manager_interface.h b/src/components/policy/policy_regular/include/policy/cache_manager_interface.h index f0ee9c2b25..bf0f17d83c 100644 --- a/src/components/policy/policy_regular/include/policy/cache_manager_interface.h +++ b/src/components/policy/policy_regular/include/policy/cache_manager_interface.h @@ -184,6 +184,14 @@ class CacheManagerInterface { std::string& cloud_transport_type, std::string& hybrid_app_preference) const = 0; + /** + * Initializes a new cloud application with default policies + * Then adds cloud specific policies + * @param app_id application id + * @return true if success + */ + virtual void InitCloudApp(const std::string& policy_app_id) = 0; + /** * @brief Enable or disable a cloud application in the HMI * @param enabled Cloud app enabled state diff --git a/src/components/policy/policy_regular/include/policy/policy_manager_impl.h b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h index 0a0c260a96..20a37717a7 100644 --- a/src/components/policy/policy_regular/include/policy/policy_manager_impl.h +++ b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h @@ -596,6 +596,13 @@ class PolicyManagerImpl : public PolicyManager { std::string& cloud_transport_type, std::string& hybrid_app_preference) const OVERRIDE; + /** + * @ brief Initialize new cloud app in the policy table + * @ param policy_app_id Application ID + */ + + void InitCloudApp(const std::string& policy_app_id) OVERRIDE; + /** * @brief Enable or disable a cloud application in the HMI * @param enabled Cloud app enabled state diff --git a/src/components/policy/policy_regular/src/cache_manager.cc b/src/components/policy/policy_regular/src/cache_manager.cc index c4b3d8db53..2c37279baa 100644 --- a/src/components/policy/policy_regular/src/cache_manager.cc +++ b/src/components/policy/policy_regular/src/cache_manager.cc @@ -728,6 +728,27 @@ void CacheManager::GetCloudAppParameters( } } +void CacheManager::InitCloudApp(const std::string& policy_app_id) { + CACHE_MANAGER_CHECK_VOID(); + sync_primitives::AutoLock auto_lock(cache_lock_); + + policy_table::ApplicationPolicies& policies = + pt_->policy_table.app_policies_section.apps; + policy_table::ApplicationPolicies::const_iterator default_iter = + policies.find(kDefaultId); + policy_table::ApplicationPolicies::const_iterator app_iter = + policies.find(policy_app_id); + + if (default_iter != policies.end()) { + if (app_iter == policies.end()){ + policies[policy_app_id] = policies[kDefaultId]; + } + } + //Add cloud app specific policies + + Backup(); +} + void CacheManager::SetCloudAppEnabled(const std::string& policy_app_id, const bool enabled) { policy_table::ApplicationPolicies& policies = diff --git a/src/components/policy/policy_regular/src/policy_manager_impl.cc b/src/components/policy/policy_regular/src/policy_manager_impl.cc index 6e635b7f36..e2adde4524 100644 --- a/src/components/policy/policy_regular/src/policy_manager_impl.cc +++ b/src/components/policy/policy_regular/src/policy_manager_impl.cc @@ -566,6 +566,10 @@ void PolicyManagerImpl::GetCloudAppParameters( hybrid_app_preference); } +void PolicyManagerImpl::InitCloudApp(const std::string& policy_app_id){ + cache_->InitCloudApp(policy_app_id); +} + void PolicyManagerImpl::SetCloudAppEnabled(const std::string& policy_app_id, const bool enabled) { cache_->SetCloudAppEnabled(policy_app_id, enabled); -- cgit v1.2.1 From 2360fbdd7d634214a4ea86864bf7acfed0bc646d Mon Sep 17 00:00:00 2001 From: jacobkeeler Date: Thu, 15 Nov 2018 15:54:08 -0500 Subject: Address review comments --- .../application_manager/policies/policy_handler.h | 21 +++++++------- .../src/policies/policy_handler.cc | 33 +++++++++++++--------- .../policies/policy_handler_interface.h | 9 +++--- .../policy/policy_external/policy/policy_manager.h | 9 +++--- .../policy/policy_regular/policy/policy_manager.h | 9 +++--- .../policies/mock_policy_handler_interface.h | 15 +++++----- .../policy_external/policy/mock_cache_manager.h | 15 +++++----- .../policy_external/policy/mock_policy_manager.h | 15 +++++----- .../policy_regular/policy/mock_cache_manager.h | 15 +++++----- .../policy_regular/policy/mock_policy_manager.h | 15 +++++----- .../policy_external/include/policy/cache_manager.h | 20 ++++++------- .../include/policy/cache_manager_interface.h | 9 +++--- .../include/policy/policy_manager_impl.h | 20 ++++++------- .../policy/policy_external/src/cache_manager.cc | 12 ++++---- .../policy_external/src/policy_manager_impl.cc | 16 ++++++----- .../policy_regular/include/policy/cache_manager.h | 20 ++++++------- .../include/policy/cache_manager_interface.h | 9 +++--- .../include/policy/policy_manager_impl.h | 20 ++++++------- .../policy/policy_regular/src/cache_manager.cc | 6 ++-- .../policy_regular/src/policy_manager_impl.cc | 16 ++++++----- 20 files changed, 161 insertions(+), 143 deletions(-) diff --git a/src/components/application_manager/include/application_manager/policies/policy_handler.h b/src/components/application_manager/include/application_manager/policies/policy_handler.h index a612c263ca..8ee5ff64f6 100644 --- a/src/components/application_manager/include/application_manager/policies/policy_handler.h +++ b/src/components/application_manager/include/application_manager/policies/policy_handler.h @@ -419,26 +419,25 @@ class PolicyHandler : public PolicyHandlerInterface, * @brief Get cloud app policy information, all fields that aren't set for a * given app will be filled with empty strings * @param policy_app_id Unique application id + * @param enabled Whether or not the app is enabled * @param endpoint Filled with the endpoint used to connect to the cloud * application * @param certificate Filled with the certificate used to for creating a - * secure - * connection to the cloud application + * secure connection to the cloud application * @param auth_token Filled with the token used for authentication when * reconnecting to the cloud app * @param cloud_transport_type Filled with the transport type used by the * cloud application (ex. "WSS") - * @param cloud_transport_type Filled with the hybrid app preference for the + * @param hybrid_app_preference Filled with the hybrid app preference for the * cloud application set by the user - * @return true if the cloud app is enabled, false otherwise */ - const bool GetCloudAppParameters( - const std::string& policy_app_id, - std::string& endpoint, - std::string& certificate, - std::string& auth_token, - std::string& cloud_transport_type, - std::string& hybrid_app_preference) const OVERRIDE; + void GetCloudAppParameters(const std::string& policy_app_id, + bool& enabled, + std::string& endpoint, + std::string& certificate, + std::string& auth_token, + std::string& cloud_transport_type, + std::string& hybrid_app_preference) const OVERRIDE; /** * @brief Callback for when a SetCloudAppProperties message is received from a diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc index 8c6de5482c..8c026c8c75 100644 --- a/src/components/application_manager/src/policies/policy_handler.cc +++ b/src/components/application_manager/src/policies/policy_handler.cc @@ -1852,36 +1852,41 @@ void PolicyHandler::GetEnabledCloudApps( policy_manager_->GetEnabledCloudApps(enabled_apps); } -const bool PolicyHandler::GetCloudAppParameters( +void PolicyHandler::GetCloudAppParameters( const std::string& policy_app_id, + bool& enabled, std::string& endpoint, std::string& certificate, std::string& auth_token, std::string& cloud_transport_type, std::string& hybrid_app_preference) const { - POLICY_LIB_CHECK(false); - return policy_manager_->GetCloudAppParameters(policy_app_id, - endpoint, - certificate, - auth_token, - cloud_transport_type, - hybrid_app_preference); + POLICY_LIB_CHECK_VOID(); + policy_manager_->GetCloudAppParameters(policy_app_id, + enabled, + endpoint, + certificate, + auth_token, + cloud_transport_type, + hybrid_app_preference); } const bool PolicyHandler::CheckCloudAppEnabled( const std::string& policy_app_id) const { POLICY_LIB_CHECK(false); + bool enabled = false; std::string endpoint; std::string auth_token; std::string certificate; std::string cloud_transport_type; std::string hybrid_app_preference; - return policy_manager_->GetCloudAppParameters(policy_app_id, - endpoint, - certificate, - auth_token, - cloud_transport_type, - hybrid_app_preference); + policy_manager_->GetCloudAppParameters(policy_app_id, + enabled, + endpoint, + certificate, + auth_token, + cloud_transport_type, + hybrid_app_preference); + return enabled; } void PolicyHandler::OnSetCloudAppProperties( 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 ddeb1da8f7..8c8a12ced3 100644 --- a/src/components/include/application_manager/policies/policy_handler_interface.h +++ b/src/components/include/application_manager/policies/policy_handler_interface.h @@ -459,7 +459,8 @@ class PolicyHandlerInterface { * @brief Get cloud app policy information, all fields that aren't set for a * given app will be filled with empty strings * @param policy_app_id Unique application id - * @param endpoint Filled the endpoint used to connect to the cloud + * @param enabled Whether or not the app is enabled + * @param endpoint Filled with the endpoint used to connect to the cloud * application * @param certificate Filled with the certificate used to for creating a * secure connection to the cloud application @@ -467,12 +468,12 @@ class PolicyHandlerInterface { * reconnecting to the cloud app * @param cloud_transport_type Filled with the transport type used by the * cloud application (ex. "WSS") - * @param cloud_transport_type Filled with the hybrid app preference for the + * @param hybrid_app_preference Filled with the hybrid app preference for the * cloud application set by the user - * @return true if the cloud app is enabled, false otherwise */ - virtual const bool GetCloudAppParameters( + virtual void GetCloudAppParameters( const std::string& policy_app_id, + bool& enabled, std::string& endpoint, std::string& certificate, std::string& auth_token, 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 b0fac8eae9..37c8a902f1 100644 --- a/src/components/include/policy/policy_external/policy/policy_manager.h +++ b/src/components/include/policy/policy_external/policy/policy_manager.h @@ -534,7 +534,8 @@ class PolicyManager : public usage_statistics::StatisticsManager { * @brief Get cloud app policy information, all fields that aren't set for a * given app will be filled with empty strings * @param policy_app_id Unique application id - * @param endpoint Filled the endpoint used to connect to the cloud + * @param enabled Whether or not the app is enabled + * @param endpoint Filled with the endpoint used to connect to the cloud * application * @param certificate Filled with the certificate used to for creating a * secure connection to the cloud application @@ -542,12 +543,12 @@ class PolicyManager : public usage_statistics::StatisticsManager { * reconnecting to the cloud app * @param cloud_transport_type Filled with the transport type used by the * cloud application (ex. "WSS") - * @param cloud_transport_type Filled with the hybrid app preference for the + * @param hybrid_app_preference Filled with the hybrid app preference for the * cloud application set by the user - * @return true if the cloud app is enabled, false otherwise */ - virtual const bool GetCloudAppParameters( + virtual void GetCloudAppParameters( const std::string& policy_app_id, + bool& enabled, std::string& endpoint, std::string& certificate, std::string& auth_token, 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 1f0f520077..d22f52bfed 100644 --- a/src/components/include/policy/policy_regular/policy/policy_manager.h +++ b/src/components/include/policy/policy_regular/policy/policy_manager.h @@ -514,7 +514,8 @@ class PolicyManager : public usage_statistics::StatisticsManager { * @brief Get cloud app policy information, all fields that aren't set for a * given app will be filled with empty strings * @param policy_app_id Unique application id - * @param endpoint Filled the endpoint used to connect to the cloud + * @param enabled Whether or not the app is enabled + * @param endpoint Filled with the endpoint used to connect to the cloud * application * @param certificate Filled with the certificate used to for creating a * secure connection to the cloud application @@ -522,12 +523,12 @@ class PolicyManager : public usage_statistics::StatisticsManager { * reconnecting to the cloud app * @param cloud_transport_type Filled with the transport type used by the * cloud application (ex. "WSS") - * @param cloud_transport_type Filled with the hybrid app preference for the + * @param hybrid_app_preference Filled with the hybrid app preference for the * cloud application set by the user - * @return true if the cloud app is enabled, false otherwise */ - virtual const bool GetCloudAppParameters( + virtual void GetCloudAppParameters( const std::string& policy_app_id, + bool& enabled, std::string& endpoint, std::string& certificate, std::string& auth_token, 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 cea36082c8..02a0d73086 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 @@ -217,13 +217,14 @@ class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface { void(std::vector& enabled_apps)); MOCK_CONST_METHOD1(CheckCloudAppEnabled, const bool(const std::string& policy_app_id)); - MOCK_CONST_METHOD6(GetCloudAppParameters, - const bool(const std::string& policy_app_id, - std::string& endpoint, - std::string& certificate, - std::string& auth_token, - std::string& cloud_transport_type, - std::string& hybrid_app_preference)); + MOCK_CONST_METHOD7(GetCloudAppParameters, + void(const std::string& policy_app_id, + bool& enabled, + std::string& endpoint, + std::string& certificate, + std::string& auth_token, + std::string& cloud_transport_type, + std::string& hybrid_app_preference)); MOCK_METHOD1(OnSetCloudAppProperties, void(const smart_objects::SmartObject& message)); 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 03e0882129..db3f37fb91 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 @@ -78,13 +78,14 @@ class MockCacheManagerInterface : public ::policy::CacheManagerInterface { MOCK_CONST_METHOD0(GetVehicleInfo, const VehicleInfo()); MOCK_CONST_METHOD1(GetEnabledCloudApps, void(std::vector& enabled_apps)); - MOCK_CONST_METHOD6(GetCloudAppParameters, - const bool(const std::string& policy_app_id, - std::string& endpoint, - std::string& certificate, - std::string& auth_token, - std::string& cloud_transport_type, - std::string& hybrid_app_preference)); + MOCK_CONST_METHOD7(GetCloudAppParameters, + void(const std::string& policy_app_id, + bool& enabled, + std::string& endpoint, + std::string& certificate, + std::string& auth_token, + std::string& cloud_transport_type, + std::string& hybrid_app_preference)); MOCK_METHOD2(SetCloudAppEnabled, void(const std::string& policy_app_id, const bool enabled)); MOCK_METHOD2(SetAppAuthToken, 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 70dab8e99a..1eabb78019 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 @@ -186,13 +186,14 @@ class MockPolicyManager : public PolicyManager { MOCK_CONST_METHOD0(GetVehicleInfo, const policy::VehicleInfo()); MOCK_CONST_METHOD1(GetEnabledCloudApps, void(std::vector& enabled_apps)); - MOCK_CONST_METHOD6(GetCloudAppParameters, - const bool(const std::string& policy_app_id, - std::string& endpoint, - std::string& certificate, - std::string& auth_token, - std::string& cloud_transport_type, - std::string& hybrid_app_preference)); + MOCK_CONST_METHOD7(GetCloudAppParameters, + void(const std::string& policy_app_id, + bool& enabled, + std::string& endpoint, + std::string& certificate, + std::string& auth_token, + std::string& cloud_transport_type, + std::string& hybrid_app_preference)); MOCK_METHOD2(SetCloudAppEnabled, void(const std::string& policy_app_id, const bool enabled)); MOCK_METHOD2(SetAppAuthToken, 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 7ac94d278d..3d8dc4116a 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 @@ -65,13 +65,14 @@ class MockCacheManagerInterface : public CacheManagerInterface { MOCK_CONST_METHOD0(GetVehicleInfo, const VehicleInfo()); MOCK_CONST_METHOD1(GetEnabledCloudApps, void(std::vector& enabled_apps)); - MOCK_CONST_METHOD6(GetCloudAppParameters, - const bool(const std::string& policy_app_id, - std::string& endpoint, - std::string& certificate, - std::string& auth_token, - std::string& cloud_transport_type, - std::string& hybrid_app_preference)); + MOCK_CONST_METHOD7(GetCloudAppParameters, + void(const std::string& policy_app_id, + bool& enabled, + std::string& endpoint, + std::string& certificate, + std::string& auth_token, + std::string& cloud_transport_type, + std::string& hybrid_app_preference)); MOCK_METHOD2(SetCloudAppEnabled, void(const std::string& policy_app_id, const bool enabled)); MOCK_METHOD2(SetAppAuthToken, 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 7441701a34..a28ea32108 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 @@ -183,13 +183,14 @@ class MockPolicyManager : public PolicyManager { MOCK_CONST_METHOD0(GetVehicleInfo, const policy::VehicleInfo()); MOCK_CONST_METHOD1(GetEnabledCloudApps, void(std::vector& enabled_apps)); - MOCK_CONST_METHOD6(GetCloudAppParameters, - const bool(const std::string& policy_app_id, - std::string& endpoint, - std::string& certificate, - std::string& auth_token, - std::string& cloud_transport_type, - std::string& hybrid_app_preference)); + MOCK_CONST_METHOD7(GetCloudAppParameters, + void(const std::string& policy_app_id, + bool& enabled, + std::string& endpoint, + std::string& certificate, + std::string& auth_token, + std::string& cloud_transport_type, + std::string& hybrid_app_preference)); MOCK_METHOD2(SetCloudAppEnabled, void(const std::string& policy_app_id, const bool enabled)); MOCK_METHOD2(SetAppAuthToken, diff --git a/src/components/policy/policy_external/include/policy/cache_manager.h b/src/components/policy/policy_external/include/policy/cache_manager.h index 7660eb2df9..98f279b345 100644 --- a/src/components/policy/policy_external/include/policy/cache_manager.h +++ b/src/components/policy/policy_external/include/policy/cache_manager.h @@ -170,7 +170,8 @@ class CacheManager : public CacheManagerInterface { * @brief Get cloud app policy information, all fields that aren't set for a * given app will be filled with empty strings * @param policy_app_id Unique application id - * @param endpoint Filled the endpoint used to connect to the cloud + * @param enabled Whether or not the app is enabled + * @param endpoint Filled with the endpoint used to connect to the cloud * application * @param certificate Filled with the certificate used to for creating a * secure connection to the cloud application @@ -178,17 +179,16 @@ class CacheManager : public CacheManagerInterface { * reconnecting to the cloud app * @param cloud_transport_type Filled with the transport type used by the * cloud application (ex. "WSS") - * @param cloud_transport_type Filled with the hybrid app preference for the + * @param hybrid_app_preference Filled with the hybrid app preference for the * cloud application set by the user - * @return true if the cloud app is enabled, false otherwise */ - virtual const bool GetCloudAppParameters( - const std::string& policy_app_id, - std::string& endpoint, - std::string& certificate, - std::string& auth_token, - std::string& cloud_transport_type, - std::string& hybrid_app_preference) const; + virtual void GetCloudAppParameters(const std::string& policy_app_id, + bool& enabled, + std::string& endpoint, + std::string& certificate, + std::string& auth_token, + std::string& cloud_transport_type, + std::string& hybrid_app_preference) const; /** * @brief Enable or disable a cloud application in the HMI diff --git a/src/components/policy/policy_external/include/policy/cache_manager_interface.h b/src/components/policy/policy_external/include/policy/cache_manager_interface.h index 79d6f4e731..2a334876ae 100644 --- a/src/components/policy/policy_external/include/policy/cache_manager_interface.h +++ b/src/components/policy/policy_external/include/policy/cache_manager_interface.h @@ -177,7 +177,8 @@ class CacheManagerInterface { * @brief Get cloud app policy information, all fields that aren't set for a * given app will be filled with empty strings * @param policy_app_id Unique application id - * @param endpoint Filled the endpoint used to connect to the cloud + * @param enabled Whether or not the app is enabled + * @param endpoint Filled with the endpoint used to connect to the cloud * application * @param certificate Filled with the certificate used to for creating a * secure connection to the cloud application @@ -185,12 +186,12 @@ class CacheManagerInterface { * reconnecting to the cloud app * @param cloud_transport_type Filled with the transport type used by the * cloud application (ex. "WSS") - * @param cloud_transport_type Filled with the hybrid app preference for the + * @param hybrid_app_preference Filled with the hybrid app preference for the * cloud application set by the user - * @return true if the cloud app is enabled, false otherwise */ - virtual const bool GetCloudAppParameters( + virtual void GetCloudAppParameters( const std::string& policy_app_id, + bool& enabled, std::string& endpoint, std::string& certificate, std::string& auth_token, diff --git a/src/components/policy/policy_external/include/policy/policy_manager_impl.h b/src/components/policy/policy_external/include/policy/policy_manager_impl.h index 778892df13..6d4cbbf773 100644 --- a/src/components/policy/policy_external/include/policy/policy_manager_impl.h +++ b/src/components/policy/policy_external/include/policy/policy_manager_impl.h @@ -582,7 +582,8 @@ class PolicyManagerImpl : public PolicyManager { * @brief Get cloud app policy information, all fields that aren't set for a * given app will be filled with empty strings * @param policy_app_id Unique application id - * @param endpoint Filled the endpoint used to connect to the cloud + * @param enabled Whether or not the app is enabled + * @param endpoint Filled with the endpoint used to connect to the cloud * application * @param certificate Filled with the certificate used to for creating a * secure connection to the cloud application @@ -590,17 +591,16 @@ class PolicyManagerImpl : public PolicyManager { * reconnecting to the cloud app * @param cloud_transport_type Filled with the transport type used by the * cloud application (ex. "WSS") - * @param cloud_transport_type Filled with the hybrid app preference for the + * @param hybrid_app_preference Filled with the hybrid app preference for the * cloud application set by the user - * @return true if the cloud app is enabled, false otherwise */ - const bool GetCloudAppParameters( - const std::string& policy_app_id, - std::string& endpoint, - std::string& certificate, - std::string& auth_token, - std::string& cloud_transport_type, - std::string& hybrid_app_preference) const OVERRIDE; + void GetCloudAppParameters(const std::string& policy_app_id, + bool& enabled, + std::string& endpoint, + std::string& certificate, + std::string& auth_token, + std::string& cloud_transport_type, + std::string& hybrid_app_preference) const OVERRIDE; /** * @brief Enable or disable a cloud application in the HMI diff --git a/src/components/policy/policy_external/src/cache_manager.cc b/src/components/policy/policy_external/src/cache_manager.cc index 116b315755..dc0838d429 100644 --- a/src/components/policy/policy_external/src/cache_manager.cc +++ b/src/components/policy/policy_external/src/cache_manager.cc @@ -1403,8 +1403,9 @@ void CacheManager::GetEnabledCloudApps( } } -const bool CacheManager::GetCloudAppParameters( +void CacheManager::GetCloudAppParameters( const std::string& policy_app_id, + bool& enabled, std::string& endpoint, std::string& certificate, std::string& auth_token, @@ -1418,21 +1419,20 @@ const bool CacheManager::GetCloudAppParameters( auto app_policy = (*policy_iter).second; endpoint = app_policy.endpoint.is_initialized() ? *app_policy.endpoint : std::string(); - certificate = app_policy.certificate.is_initialized() - ? *app_policy.certificate - : std::string(); auth_token = app_policy.auth_token.is_initialized() ? *app_policy.auth_token : std::string(); cloud_transport_type = app_policy.cloud_transport_type.is_initialized() ? *app_policy.cloud_transport_type : std::string(); + certificate = app_policy.certificate.is_initialized() + ? *app_policy.certificate + : std::string(); hybrid_app_preference = app_policy.hybrid_app_preference.is_initialized() ? EnumToJsonString(*app_policy.hybrid_app_preference) : std::string(); - return app_policy.enabled.is_initialized() && *app_policy.enabled; + enabled = app_policy.enabled.is_initialized() && *app_policy.enabled; } - return false; } void CacheManager::SetCloudAppEnabled(const std::string& policy_app_id, diff --git a/src/components/policy/policy_external/src/policy_manager_impl.cc b/src/components/policy/policy_external/src/policy_manager_impl.cc index 31cc212254..df474268ba 100644 --- a/src/components/policy/policy_external/src/policy_manager_impl.cc +++ b/src/components/policy/policy_external/src/policy_manager_impl.cc @@ -730,19 +730,21 @@ void PolicyManagerImpl::GetEnabledCloudApps( cache_->GetEnabledCloudApps(enabled_apps); } -const bool PolicyManagerImpl::GetCloudAppParameters( +void PolicyManagerImpl::GetCloudAppParameters( const std::string& policy_app_id, + bool& enabled, std::string& endpoint, std::string& certificate, std::string& auth_token, std::string& cloud_transport_type, std::string& hybrid_app_preference) const { - return cache_->GetCloudAppParameters(policy_app_id, - endpoint, - certificate, - auth_token, - cloud_transport_type, - hybrid_app_preference); + cache_->GetCloudAppParameters(policy_app_id, + enabled, + endpoint, + certificate, + auth_token, + cloud_transport_type, + hybrid_app_preference); } void PolicyManagerImpl::SetCloudAppEnabled(const std::string& policy_app_id, diff --git a/src/components/policy/policy_regular/include/policy/cache_manager.h b/src/components/policy/policy_regular/include/policy/cache_manager.h index 39f9cc73cd..a4ae45d604 100644 --- a/src/components/policy/policy_regular/include/policy/cache_manager.h +++ b/src/components/policy/policy_regular/include/policy/cache_manager.h @@ -158,7 +158,8 @@ class CacheManager : public CacheManagerInterface { * @brief Get cloud app policy information, all fields that aren't set for a * given app will be filled with empty strings * @param policy_app_id Unique application id - * @param endpoint Filled the endpoint used to connect to the cloud + * @param enabled Whether or not the app is enabled + * @param endpoint Filled with the endpoint used to connect to the cloud * application * @param certificate Filled with the certificate used to for creating a * secure connection to the cloud application @@ -166,17 +167,16 @@ class CacheManager : public CacheManagerInterface { * reconnecting to the cloud app * @param cloud_transport_type Filled with the transport type used by the * cloud application (ex. "WSS") - * @param cloud_transport_type Filled with the hybrid app preference for the + * @param hybrid_app_preference Filled with the hybrid app preference for the * cloud application set by the user - * @return true if the cloud app is enabled, false otherwise */ - virtual const bool GetCloudAppParameters( - const std::string& policy_app_id, - std::string& endpoint, - std::string& certificate, - std::string& auth_token, - std::string& cloud_transport_type, - std::string& hybrid_app_preference) const; + virtual void GetCloudAppParameters(const std::string& policy_app_id, + bool& enabled, + std::string& endpoint, + std::string& certificate, + std::string& auth_token, + std::string& cloud_transport_type, + std::string& hybrid_app_preference) const; /** * @brief Enable or disable a cloud application in the HMI diff --git a/src/components/policy/policy_regular/include/policy/cache_manager_interface.h b/src/components/policy/policy_regular/include/policy/cache_manager_interface.h index 3b2b10d0bc..f0ee9c2b25 100644 --- a/src/components/policy/policy_regular/include/policy/cache_manager_interface.h +++ b/src/components/policy/policy_regular/include/policy/cache_manager_interface.h @@ -163,7 +163,8 @@ class CacheManagerInterface { * @brief Get cloud app policy information, all fields that aren't set for a * given app will be filled with empty strings * @param policy_app_id Unique application id - * @param endpoint Filled the endpoint used to connect to the cloud + * @param enabled Whether or not the app is enabled + * @param endpoint Filled with the endpoint used to connect to the cloud * application * @param certificate Filled with the certificate used to for creating a * secure connection to the cloud application @@ -171,12 +172,12 @@ class CacheManagerInterface { * reconnecting to the cloud app * @param cloud_transport_type Filled with the transport type used by the * cloud application (ex. "WSS") - * @param cloud_transport_type Filled with the hybrid app preference for the + * @param hybrid_app_preference Filled with the hybrid app preference for the * cloud application set by the user - * @return true if the cloud app is enabled, false otherwise */ - virtual const bool GetCloudAppParameters( + virtual void GetCloudAppParameters( const std::string& policy_app_id, + bool& enabled, std::string& endpoint, std::string& certificate, std::string& auth_token, diff --git a/src/components/policy/policy_regular/include/policy/policy_manager_impl.h b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h index 311ced31d2..0a0c260a96 100644 --- a/src/components/policy/policy_regular/include/policy/policy_manager_impl.h +++ b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h @@ -576,7 +576,8 @@ class PolicyManagerImpl : public PolicyManager { * @brief Get cloud app policy information, all fields that aren't set for a * given app will be filled with empty strings * @param policy_app_id Unique application id - * @param endpoint Filled the endpoint used to connect to the cloud + * @param enabled Whether or not the app is enabled + * @param endpoint Filled with the endpoint used to connect to the cloud * application * @param certificate Filled with the certificate used to for creating a * secure connection to the cloud application @@ -584,17 +585,16 @@ class PolicyManagerImpl : public PolicyManager { * reconnecting to the cloud app * @param cloud_transport_type Filled with the transport type used by the * cloud application (ex. "WSS") - * @param cloud_transport_type Filled with the hybrid app preference for the + * @param hybrid_app_preference Filled with the hybrid app preference for the * cloud application set by the user - * @return true if the cloud app is enabled, false otherwise */ - const bool GetCloudAppParameters( - const std::string& policy_app_id, - std::string& endpoint, - std::string& certificate, - std::string& auth_token, - std::string& cloud_transport_type, - std::string& hybrid_app_preference) const OVERRIDE; + void GetCloudAppParameters(const std::string& policy_app_id, + bool& enabled, + std::string& endpoint, + std::string& certificate, + std::string& auth_token, + std::string& cloud_transport_type, + std::string& hybrid_app_preference) const OVERRIDE; /** * @brief Enable or disable a cloud application in the HMI diff --git a/src/components/policy/policy_regular/src/cache_manager.cc b/src/components/policy/policy_regular/src/cache_manager.cc index 9292c389b9..c4b3d8db53 100644 --- a/src/components/policy/policy_regular/src/cache_manager.cc +++ b/src/components/policy/policy_regular/src/cache_manager.cc @@ -696,8 +696,9 @@ void CacheManager::GetEnabledCloudApps( } } -const bool CacheManager::GetCloudAppParameters( +void CacheManager::GetCloudAppParameters( const std::string& policy_app_id, + bool& enabled, std::string& endpoint, std::string& certificate, std::string& auth_token, @@ -723,9 +724,8 @@ const bool CacheManager::GetCloudAppParameters( app_policy.hybrid_app_preference.is_initialized() ? EnumToJsonString(*app_policy.hybrid_app_preference) : std::string(); - return app_policy.enabled.is_initialized() && *app_policy.enabled; + enabled = app_policy.enabled.is_initialized() && *app_policy.enabled; } - return false; } void CacheManager::SetCloudAppEnabled(const std::string& policy_app_id, diff --git a/src/components/policy/policy_regular/src/policy_manager_impl.cc b/src/components/policy/policy_regular/src/policy_manager_impl.cc index 5aa29fc896..6e635b7f36 100644 --- a/src/components/policy/policy_regular/src/policy_manager_impl.cc +++ b/src/components/policy/policy_regular/src/policy_manager_impl.cc @@ -549,19 +549,21 @@ void PolicyManagerImpl::GetEnabledCloudApps( cache_->GetEnabledCloudApps(enabled_apps); } -const bool PolicyManagerImpl::GetCloudAppParameters( +void PolicyManagerImpl::GetCloudAppParameters( const std::string& policy_app_id, + bool& enabled, std::string& endpoint, std::string& certificate, std::string& auth_token, std::string& cloud_transport_type, std::string& hybrid_app_preference) const { - return cache_->GetCloudAppParameters(policy_app_id, - endpoint, - certificate, - auth_token, - cloud_transport_type, - hybrid_app_preference); + cache_->GetCloudAppParameters(policy_app_id, + enabled, + endpoint, + certificate, + auth_token, + cloud_transport_type, + hybrid_app_preference); } void PolicyManagerImpl::SetCloudAppEnabled(const std::string& policy_app_id, -- cgit v1.2.1 From bb46d3110e06067466a25dcc9973e79909552996 Mon Sep 17 00:00:00 2001 From: ShobhitAd Date: Fri, 16 Nov 2018 12:54:22 -0500 Subject: Implemented InitCloudApp in policy_regular --- .../src/policies/policy_handler.cc | 3 +++ .../policy/policy_regular/policy/policy_manager.h | 7 +++++++ .../policy_regular/include/policy/cache_manager.h | 9 +++++++++ .../include/policy/cache_manager_interface.h | 8 ++++++++ .../include/policy/policy_manager_impl.h | 7 +++++++ .../policy/policy_regular/src/cache_manager.cc | 21 +++++++++++++++++++++ .../policy_regular/src/policy_manager_impl.cc | 4 ++++ 7 files changed, 59 insertions(+) diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc index 8c026c8c75..c603659353 100644 --- a/src/components/application_manager/src/policies/policy_handler.cc +++ b/src/components/application_manager/src/policies/policy_handler.cc @@ -1906,6 +1906,9 @@ void PolicyHandler::OnSetCloudAppProperties( return; } std::string policy_app_id(msg_params[strings::app_id].asString()); + + policy_manager_->InitCloudApp(policy_app_id); + if (msg_params.keyExists(strings::enabled)) { policy_manager_->SetCloudAppEnabled(policy_app_id, msg_params[strings::enabled].asBool()); 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 d22f52bfed..b2d48585f4 100644 --- a/src/components/include/policy/policy_regular/policy/policy_manager.h +++ b/src/components/include/policy/policy_regular/policy/policy_manager.h @@ -535,6 +535,13 @@ class PolicyManager : public usage_statistics::StatisticsManager { std::string& cloud_transport_type, std::string& hybrid_app_preference) const = 0; + /** + * @ brief Initialize new cloud app in the policy table + * @ param policy_app_id Application ID + */ + + virtual void InitCloudApp(const std::string& policy_app_id) = 0; + /** * @brief Enable or disable a cloud application in the HMI * @param enabled Cloud app enabled state diff --git a/src/components/policy/policy_regular/include/policy/cache_manager.h b/src/components/policy/policy_regular/include/policy/cache_manager.h index a4ae45d604..0ce35b5beb 100644 --- a/src/components/policy/policy_regular/include/policy/cache_manager.h +++ b/src/components/policy/policy_regular/include/policy/cache_manager.h @@ -178,6 +178,15 @@ class CacheManager : public CacheManagerInterface { std::string& cloud_transport_type, std::string& hybrid_app_preference) const; + /** + * Initializes a new cloud application with default policies + * Then adds cloud specific policies + * @param app_id application id + * @return true if success + */ + virtual void InitCloudApp(const std::string& policy_app_id); + + /** * @brief Enable or disable a cloud application in the HMI * @param enabled Cloud app enabled state diff --git a/src/components/policy/policy_regular/include/policy/cache_manager_interface.h b/src/components/policy/policy_regular/include/policy/cache_manager_interface.h index f0ee9c2b25..bf0f17d83c 100644 --- a/src/components/policy/policy_regular/include/policy/cache_manager_interface.h +++ b/src/components/policy/policy_regular/include/policy/cache_manager_interface.h @@ -184,6 +184,14 @@ class CacheManagerInterface { std::string& cloud_transport_type, std::string& hybrid_app_preference) const = 0; + /** + * Initializes a new cloud application with default policies + * Then adds cloud specific policies + * @param app_id application id + * @return true if success + */ + virtual void InitCloudApp(const std::string& policy_app_id) = 0; + /** * @brief Enable or disable a cloud application in the HMI * @param enabled Cloud app enabled state diff --git a/src/components/policy/policy_regular/include/policy/policy_manager_impl.h b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h index 0a0c260a96..20a37717a7 100644 --- a/src/components/policy/policy_regular/include/policy/policy_manager_impl.h +++ b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h @@ -596,6 +596,13 @@ class PolicyManagerImpl : public PolicyManager { std::string& cloud_transport_type, std::string& hybrid_app_preference) const OVERRIDE; + /** + * @ brief Initialize new cloud app in the policy table + * @ param policy_app_id Application ID + */ + + void InitCloudApp(const std::string& policy_app_id) OVERRIDE; + /** * @brief Enable or disable a cloud application in the HMI * @param enabled Cloud app enabled state diff --git a/src/components/policy/policy_regular/src/cache_manager.cc b/src/components/policy/policy_regular/src/cache_manager.cc index c4b3d8db53..2c37279baa 100644 --- a/src/components/policy/policy_regular/src/cache_manager.cc +++ b/src/components/policy/policy_regular/src/cache_manager.cc @@ -728,6 +728,27 @@ void CacheManager::GetCloudAppParameters( } } +void CacheManager::InitCloudApp(const std::string& policy_app_id) { + CACHE_MANAGER_CHECK_VOID(); + sync_primitives::AutoLock auto_lock(cache_lock_); + + policy_table::ApplicationPolicies& policies = + pt_->policy_table.app_policies_section.apps; + policy_table::ApplicationPolicies::const_iterator default_iter = + policies.find(kDefaultId); + policy_table::ApplicationPolicies::const_iterator app_iter = + policies.find(policy_app_id); + + if (default_iter != policies.end()) { + if (app_iter == policies.end()){ + policies[policy_app_id] = policies[kDefaultId]; + } + } + //Add cloud app specific policies + + Backup(); +} + void CacheManager::SetCloudAppEnabled(const std::string& policy_app_id, const bool enabled) { policy_table::ApplicationPolicies& policies = diff --git a/src/components/policy/policy_regular/src/policy_manager_impl.cc b/src/components/policy/policy_regular/src/policy_manager_impl.cc index 6e635b7f36..e2adde4524 100644 --- a/src/components/policy/policy_regular/src/policy_manager_impl.cc +++ b/src/components/policy/policy_regular/src/policy_manager_impl.cc @@ -566,6 +566,10 @@ void PolicyManagerImpl::GetCloudAppParameters( hybrid_app_preference); } +void PolicyManagerImpl::InitCloudApp(const std::string& policy_app_id){ + cache_->InitCloudApp(policy_app_id); +} + void PolicyManagerImpl::SetCloudAppEnabled(const std::string& policy_app_id, const bool enabled) { cache_->SetCloudAppEnabled(policy_app_id, enabled); -- cgit v1.2.1 From 61f6a0e75b1550689becf07e6b9aaad16c7a4910 Mon Sep 17 00:00:00 2001 From: ShobhitAd Date: Fri, 16 Nov 2018 14:26:11 -0500 Subject: Implement InitCloudApp in policy_external --- .../policy/policy_external/policy/policy_manager.h | 8 +++++++- .../policy_external/include/policy/cache_manager.h | 8 ++++++++ .../include/policy/cache_manager_interface.h | 8 ++++++++ .../include/policy/policy_manager_impl.h | 6 ++++++ .../policy/policy_external/src/cache_manager.cc | 19 +++++++++++++++++++ .../policy/policy_external/src/policy_manager_impl.cc | 4 ++++ 6 files changed, 52 insertions(+), 1 deletion(-) 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 37c8a902f1..54dde0d8cf 100644 --- a/src/components/include/policy/policy_external/policy/policy_manager.h +++ b/src/components/include/policy/policy_external/policy/policy_manager.h @@ -554,7 +554,13 @@ class PolicyManager : public usage_statistics::StatisticsManager { std::string& auth_token, std::string& cloud_transport_type, std::string& hybrid_app_preference) const = 0; - + + /** + * @ brief Initialize new cloud app in the policy table + * @ param policy_app_id Application ID + */ + virtual void InitCloudApp(const std::string& policy_app_id) = 0; + /** * @brief Enable or disable a cloud application in the HMI * @param enabled Cloud app enabled state diff --git a/src/components/policy/policy_external/include/policy/cache_manager.h b/src/components/policy/policy_external/include/policy/cache_manager.h index 98f279b345..e5258e36c8 100644 --- a/src/components/policy/policy_external/include/policy/cache_manager.h +++ b/src/components/policy/policy_external/include/policy/cache_manager.h @@ -189,6 +189,14 @@ class CacheManager : public CacheManagerInterface { std::string& auth_token, std::string& cloud_transport_type, std::string& hybrid_app_preference) const; + + /** + * Initializes a new cloud application with default policies + * Then adds cloud specific policies + * @param app_id application id + * @return true if success + */ + virtual void InitCloudApp(const std::string& policy_app_id); /** * @brief Enable or disable a cloud application in the HMI diff --git a/src/components/policy/policy_external/include/policy/cache_manager_interface.h b/src/components/policy/policy_external/include/policy/cache_manager_interface.h index 2a334876ae..aba3e32004 100644 --- a/src/components/policy/policy_external/include/policy/cache_manager_interface.h +++ b/src/components/policy/policy_external/include/policy/cache_manager_interface.h @@ -198,6 +198,14 @@ class CacheManagerInterface { std::string& cloud_transport_type, std::string& hybrid_app_preference) const = 0; + /** + * Initializes a new cloud application with default policies + * Then adds cloud specific policies + * @param app_id application id + * @return true if success + */ + virtual void InitCloudApp(const std::string& policy_app_id) = 0; + /** * @brief Enable or disable a cloud application in the HMI * @param enabled Cloud app enabled state diff --git a/src/components/policy/policy_external/include/policy/policy_manager_impl.h b/src/components/policy/policy_external/include/policy/policy_manager_impl.h index 6d4cbbf773..d9bec20791 100644 --- a/src/components/policy/policy_external/include/policy/policy_manager_impl.h +++ b/src/components/policy/policy_external/include/policy/policy_manager_impl.h @@ -602,6 +602,12 @@ class PolicyManagerImpl : public PolicyManager { std::string& cloud_transport_type, std::string& hybrid_app_preference) const OVERRIDE; + /** + * @ brief Initialize new cloud app in the policy table + * @ param policy_app_id Application ID + */ + void InitCloudApp(const std::string& policy_app_id) OVERRIDE; + /** * @brief Enable or disable a cloud application in the HMI * @param enabled Cloud app enabled state diff --git a/src/components/policy/policy_external/src/cache_manager.cc b/src/components/policy/policy_external/src/cache_manager.cc index dc0838d429..31f0f4110e 100644 --- a/src/components/policy/policy_external/src/cache_manager.cc +++ b/src/components/policy/policy_external/src/cache_manager.cc @@ -1435,6 +1435,25 @@ void CacheManager::GetCloudAppParameters( } } +void CacheManager::InitCloudApp(const std::string& policy_app_id) { + CACHE_MANAGER_CHECK_VOID(); + sync_primitives::AutoLock auto_lock(cache_lock_); + + policy_table::ApplicationPolicies& policies = + pt_->policy_table.app_policies_section.apps; + policy_table::ApplicationPolicies::const_iterator default_iter = + policies.find(kDefaultId); + policy_table::ApplicationPolicies::const_iterator app_iter = + policies.find(policy_app_id); + if (default_iter != policies.end()) { + if (app_iter == policies.end()){ + policies[policy_app_id] = policies[kDefaultId]; + } + } + //Add cloud app specific policies + Backup(); +} + void CacheManager::SetCloudAppEnabled(const std::string& policy_app_id, const bool enabled) { policy_table::ApplicationPolicies& policies = diff --git a/src/components/policy/policy_external/src/policy_manager_impl.cc b/src/components/policy/policy_external/src/policy_manager_impl.cc index df474268ba..1aa6776011 100644 --- a/src/components/policy/policy_external/src/policy_manager_impl.cc +++ b/src/components/policy/policy_external/src/policy_manager_impl.cc @@ -747,6 +747,10 @@ void PolicyManagerImpl::GetCloudAppParameters( hybrid_app_preference); } +void PolicyManagerImpl::InitCloudApp(const std::string& policy_app_id){ + cache_->InitCloudApp(policy_app_id); +} + void PolicyManagerImpl::SetCloudAppEnabled(const std::string& policy_app_id, const bool enabled) { cache_->SetCloudAppEnabled(policy_app_id, enabled); -- cgit v1.2.1 From 293eff01d166b8b7e214bf9e0f1cd36d930b764e Mon Sep 17 00:00:00 2001 From: ShobhitAd Date: Fri, 16 Nov 2018 14:39:14 -0500 Subject: Added InitCloudApp to mock policy files --- .../include/test/policy/policy_external/policy/mock_cache_manager.h | 2 ++ .../include/test/policy/policy_external/policy/mock_policy_manager.h | 2 ++ .../include/test/policy/policy_regular/policy/mock_cache_manager.h | 2 ++ .../include/test/policy/policy_regular/policy/mock_policy_manager.h | 2 ++ 4 files changed, 8 insertions(+) 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 db3f37fb91..d426107200 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 @@ -86,6 +86,8 @@ class MockCacheManagerInterface : public ::policy::CacheManagerInterface { std::string& auth_token, std::string& cloud_transport_type, std::string& hybrid_app_preference)); + MOCK_METHOD1(InitCloudApp, + void(const std::string& policy_app_id)); MOCK_METHOD2(SetCloudAppEnabled, void(const std::string& policy_app_id, const bool enabled)); MOCK_METHOD2(SetAppAuthToken, 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 1eabb78019..dfcea6c65c 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 @@ -194,6 +194,8 @@ class MockPolicyManager : public PolicyManager { std::string& auth_token, std::string& cloud_transport_type, std::string& hybrid_app_preference)); + MOCK_METHOD1(InitCloudApp, + void(const std::string& policy_app_id)); MOCK_METHOD2(SetCloudAppEnabled, void(const std::string& policy_app_id, const bool enabled)); MOCK_METHOD2(SetAppAuthToken, 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 3d8dc4116a..703c1c9c8b 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 @@ -73,6 +73,8 @@ class MockCacheManagerInterface : public CacheManagerInterface { std::string& auth_token, std::string& cloud_transport_type, std::string& hybrid_app_preference)); + MOCK_METHOD1(InitCloudApp, + void(const std::string& policy_app_id)); MOCK_METHOD2(SetCloudAppEnabled, void(const std::string& policy_app_id, const bool enabled)); MOCK_METHOD2(SetAppAuthToken, 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 a28ea32108..f63cc21c83 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 @@ -191,6 +191,8 @@ class MockPolicyManager : public PolicyManager { std::string& auth_token, std::string& cloud_transport_type, std::string& hybrid_app_preference)); + MOCK_METHOD1(InitCloudApp, + void(const std::string& policy_app_id)); MOCK_METHOD2(SetCloudAppEnabled, void(const std::string& policy_app_id, const bool enabled)); MOCK_METHOD2(SetAppAuthToken, -- cgit v1.2.1 From 9fd56f753dd18e002b8b85a3a328e393113a72fa Mon Sep 17 00:00:00 2001 From: ShobhitAd Date: Fri, 16 Nov 2018 14:42:38 -0500 Subject: Style fix --- .../policy/policy_external/policy/policy_manager.h | 6 +++--- .../policy_external/policy/mock_cache_manager.h | 3 +-- .../policy_external/policy/mock_policy_manager.h | 3 +-- .../policy_regular/policy/mock_cache_manager.h | 3 +-- .../policy_regular/policy/mock_policy_manager.h | 3 +-- .../policy_external/include/policy/cache_manager.h | 2 +- .../include/policy/cache_manager_interface.h | 12 ++++++------ .../include/policy/policy_manager_impl.h | 2 +- .../policy/policy_external/src/cache_manager.cc | 20 ++++++++++---------- .../policy_external/src/policy_manager_impl.cc | 2 +- .../policy_regular/include/policy/cache_manager.h | 1 - .../include/policy/cache_manager_interface.h | 2 +- .../policy/policy_regular/src/cache_manager.cc | 16 ++++++++-------- .../policy/policy_regular/src/policy_manager_impl.cc | 2 +- 14 files changed, 36 insertions(+), 41 deletions(-) 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 54dde0d8cf..92c0305279 100644 --- a/src/components/include/policy/policy_external/policy/policy_manager.h +++ b/src/components/include/policy/policy_external/policy/policy_manager.h @@ -554,13 +554,13 @@ class PolicyManager : public usage_statistics::StatisticsManager { std::string& auth_token, std::string& cloud_transport_type, std::string& hybrid_app_preference) const = 0; - + /** * @ brief Initialize new cloud app in the policy table * @ param policy_app_id Application ID */ - virtual void InitCloudApp(const std::string& policy_app_id) = 0; - + virtual void InitCloudApp(const std::string& policy_app_id) = 0; + /** * @brief Enable or disable a cloud application in the HMI * @param enabled Cloud app enabled state 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 d426107200..da2b4cc2a1 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 @@ -86,8 +86,7 @@ class MockCacheManagerInterface : public ::policy::CacheManagerInterface { std::string& auth_token, std::string& cloud_transport_type, std::string& hybrid_app_preference)); - MOCK_METHOD1(InitCloudApp, - void(const std::string& policy_app_id)); + MOCK_METHOD1(InitCloudApp, void(const std::string& policy_app_id)); MOCK_METHOD2(SetCloudAppEnabled, void(const std::string& policy_app_id, const bool enabled)); MOCK_METHOD2(SetAppAuthToken, 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 dfcea6c65c..72dcb147e3 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 @@ -194,8 +194,7 @@ class MockPolicyManager : public PolicyManager { std::string& auth_token, std::string& cloud_transport_type, std::string& hybrid_app_preference)); - MOCK_METHOD1(InitCloudApp, - void(const std::string& policy_app_id)); + MOCK_METHOD1(InitCloudApp, void(const std::string& policy_app_id)); MOCK_METHOD2(SetCloudAppEnabled, void(const std::string& policy_app_id, const bool enabled)); MOCK_METHOD2(SetAppAuthToken, 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 703c1c9c8b..24fe9b2393 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 @@ -73,8 +73,7 @@ class MockCacheManagerInterface : public CacheManagerInterface { std::string& auth_token, std::string& cloud_transport_type, std::string& hybrid_app_preference)); - MOCK_METHOD1(InitCloudApp, - void(const std::string& policy_app_id)); + MOCK_METHOD1(InitCloudApp, void(const std::string& policy_app_id)); MOCK_METHOD2(SetCloudAppEnabled, void(const std::string& policy_app_id, const bool enabled)); MOCK_METHOD2(SetAppAuthToken, 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 f63cc21c83..a5ce488e1a 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 @@ -191,8 +191,7 @@ class MockPolicyManager : public PolicyManager { std::string& auth_token, std::string& cloud_transport_type, std::string& hybrid_app_preference)); - MOCK_METHOD1(InitCloudApp, - void(const std::string& policy_app_id)); + MOCK_METHOD1(InitCloudApp, void(const std::string& policy_app_id)); MOCK_METHOD2(SetCloudAppEnabled, void(const std::string& policy_app_id, const bool enabled)); MOCK_METHOD2(SetAppAuthToken, diff --git a/src/components/policy/policy_external/include/policy/cache_manager.h b/src/components/policy/policy_external/include/policy/cache_manager.h index e5258e36c8..3344b149e4 100644 --- a/src/components/policy/policy_external/include/policy/cache_manager.h +++ b/src/components/policy/policy_external/include/policy/cache_manager.h @@ -189,7 +189,7 @@ class CacheManager : public CacheManagerInterface { std::string& auth_token, std::string& cloud_transport_type, std::string& hybrid_app_preference) const; - + /** * Initializes a new cloud application with default policies * Then adds cloud specific policies diff --git a/src/components/policy/policy_external/include/policy/cache_manager_interface.h b/src/components/policy/policy_external/include/policy/cache_manager_interface.h index aba3e32004..6a172e6f4b 100644 --- a/src/components/policy/policy_external/include/policy/cache_manager_interface.h +++ b/src/components/policy/policy_external/include/policy/cache_manager_interface.h @@ -198,12 +198,12 @@ class CacheManagerInterface { std::string& cloud_transport_type, std::string& hybrid_app_preference) const = 0; - /** - * Initializes a new cloud application with default policies - * Then adds cloud specific policies - * @param app_id application id - * @return true if success - */ + /** + * Initializes a new cloud application with default policies + * Then adds cloud specific policies + * @param app_id application id + * @return true if success + */ virtual void InitCloudApp(const std::string& policy_app_id) = 0; /** diff --git a/src/components/policy/policy_external/include/policy/policy_manager_impl.h b/src/components/policy/policy_external/include/policy/policy_manager_impl.h index d9bec20791..399c95170d 100644 --- a/src/components/policy/policy_external/include/policy/policy_manager_impl.h +++ b/src/components/policy/policy_external/include/policy/policy_manager_impl.h @@ -606,7 +606,7 @@ class PolicyManagerImpl : public PolicyManager { * @ brief Initialize new cloud app in the policy table * @ param policy_app_id Application ID */ - void InitCloudApp(const std::string& policy_app_id) OVERRIDE; + void InitCloudApp(const std::string& policy_app_id) OVERRIDE; /** * @brief Enable or disable a cloud application in the HMI diff --git a/src/components/policy/policy_external/src/cache_manager.cc b/src/components/policy/policy_external/src/cache_manager.cc index 31f0f4110e..8cec6ef91c 100644 --- a/src/components/policy/policy_external/src/cache_manager.cc +++ b/src/components/policy/policy_external/src/cache_manager.cc @@ -1439,19 +1439,19 @@ void CacheManager::InitCloudApp(const std::string& policy_app_id) { CACHE_MANAGER_CHECK_VOID(); sync_primitives::AutoLock auto_lock(cache_lock_); - policy_table::ApplicationPolicies& policies = - pt_->policy_table.app_policies_section.apps; - policy_table::ApplicationPolicies::const_iterator default_iter = - policies.find(kDefaultId); - policy_table::ApplicationPolicies::const_iterator app_iter = - policies.find(policy_app_id); - if (default_iter != policies.end()) { - if (app_iter == policies.end()){ + policy_table::ApplicationPolicies& policies = + pt_->policy_table.app_policies_section.apps; + policy_table::ApplicationPolicies::const_iterator default_iter = + policies.find(kDefaultId); + policy_table::ApplicationPolicies::const_iterator app_iter = + policies.find(policy_app_id); + if (default_iter != policies.end()) { + if (app_iter == policies.end()) { policies[policy_app_id] = policies[kDefaultId]; } } - //Add cloud app specific policies - Backup(); + // Add cloud app specific policies + Backup(); } void CacheManager::SetCloudAppEnabled(const std::string& policy_app_id, diff --git a/src/components/policy/policy_external/src/policy_manager_impl.cc b/src/components/policy/policy_external/src/policy_manager_impl.cc index 1aa6776011..0844edd8eb 100644 --- a/src/components/policy/policy_external/src/policy_manager_impl.cc +++ b/src/components/policy/policy_external/src/policy_manager_impl.cc @@ -747,7 +747,7 @@ void PolicyManagerImpl::GetCloudAppParameters( hybrid_app_preference); } -void PolicyManagerImpl::InitCloudApp(const std::string& policy_app_id){ +void PolicyManagerImpl::InitCloudApp(const std::string& policy_app_id) { cache_->InitCloudApp(policy_app_id); } diff --git a/src/components/policy/policy_regular/include/policy/cache_manager.h b/src/components/policy/policy_regular/include/policy/cache_manager.h index 0ce35b5beb..8c8f0c55c6 100644 --- a/src/components/policy/policy_regular/include/policy/cache_manager.h +++ b/src/components/policy/policy_regular/include/policy/cache_manager.h @@ -186,7 +186,6 @@ class CacheManager : public CacheManagerInterface { */ virtual void InitCloudApp(const std::string& policy_app_id); - /** * @brief Enable or disable a cloud application in the HMI * @param enabled Cloud app enabled state diff --git a/src/components/policy/policy_regular/include/policy/cache_manager_interface.h b/src/components/policy/policy_regular/include/policy/cache_manager_interface.h index bf0f17d83c..50b546ecc5 100644 --- a/src/components/policy/policy_regular/include/policy/cache_manager_interface.h +++ b/src/components/policy/policy_regular/include/policy/cache_manager_interface.h @@ -191,7 +191,7 @@ class CacheManagerInterface { * @return true if success */ virtual void InitCloudApp(const std::string& policy_app_id) = 0; - + /** * @brief Enable or disable a cloud application in the HMI * @param enabled Cloud app enabled state diff --git a/src/components/policy/policy_regular/src/cache_manager.cc b/src/components/policy/policy_regular/src/cache_manager.cc index 2c37279baa..ca61a338f1 100644 --- a/src/components/policy/policy_regular/src/cache_manager.cc +++ b/src/components/policy/policy_regular/src/cache_manager.cc @@ -732,19 +732,19 @@ void CacheManager::InitCloudApp(const std::string& policy_app_id) { CACHE_MANAGER_CHECK_VOID(); sync_primitives::AutoLock auto_lock(cache_lock_); - policy_table::ApplicationPolicies& policies = - pt_->policy_table.app_policies_section.apps; - policy_table::ApplicationPolicies::const_iterator default_iter = - policies.find(kDefaultId); - policy_table::ApplicationPolicies::const_iterator app_iter = - policies.find(policy_app_id); + policy_table::ApplicationPolicies& policies = + pt_->policy_table.app_policies_section.apps; + policy_table::ApplicationPolicies::const_iterator default_iter = + policies.find(kDefaultId); + policy_table::ApplicationPolicies::const_iterator app_iter = + policies.find(policy_app_id); if (default_iter != policies.end()) { - if (app_iter == policies.end()){ + if (app_iter == policies.end()) { policies[policy_app_id] = policies[kDefaultId]; } } - //Add cloud app specific policies + // Add cloud app specific policies Backup(); } diff --git a/src/components/policy/policy_regular/src/policy_manager_impl.cc b/src/components/policy/policy_regular/src/policy_manager_impl.cc index e2adde4524..9b2392a015 100644 --- a/src/components/policy/policy_regular/src/policy_manager_impl.cc +++ b/src/components/policy/policy_regular/src/policy_manager_impl.cc @@ -566,7 +566,7 @@ void PolicyManagerImpl::GetCloudAppParameters( hybrid_app_preference); } -void PolicyManagerImpl::InitCloudApp(const std::string& policy_app_id){ +void PolicyManagerImpl::InitCloudApp(const std::string& policy_app_id) { cache_->InitCloudApp(policy_app_id); } -- cgit v1.2.1 From 2af82c8d6f0cfc2b8907d28a2e6453d0506fdb64 Mon Sep 17 00:00:00 2001 From: ShobhitAd Date: Fri, 16 Nov 2018 16:35:50 -0500 Subject: Removed redundant smart object --- .../mobile/set_cloudapp_properties_request.cc | 37 ++-------------------- 1 file changed, 2 insertions(+), 35 deletions(-) diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloudapp_properties_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloudapp_properties_request.cc index ca5a46e3dc..d92f458587 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloudapp_properties_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloudapp_properties_request.cc @@ -18,6 +18,7 @@ SetCloudAppPropertiesRequest::SetCloudAppPropertiesRequest( policy_handler) {} SetCloudAppPropertiesRequest::~SetCloudAppPropertiesRequest() {} + void SetCloudAppPropertiesRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); ApplicationSharedPtr app = application_manager_.application(connection_key()); @@ -34,41 +35,7 @@ void SetCloudAppPropertiesRequest::Run() { return; } - smart_objects::SmartObject cloud_app_properties(smart_objects::SmartType_Map); - - cloud_app_properties[strings::msg_params][strings::app_name] = - (*message_)[strings::msg_params][strings::app_name]; - cloud_app_properties[strings::msg_params][strings::app_id] = - (*message_)[strings::msg_params][strings::app_id]; - - if ((*message_)[strings::msg_params].keyExists(strings::enabled)) { - smart_objects::SmartObject enabled = - (*message_)[strings::msg_params][strings::enabled]; - cloud_app_properties[strings::msg_params][strings::enabled] = enabled; - } - if ((*message_)[strings::msg_params].keyExists( - strings::cloud_app_auth_token)) { - smart_objects::SmartObject auth_token = - (*message_)[strings::msg_params][strings::cloud_app_auth_token]; - cloud_app_properties[strings::msg_params][strings::cloud_app_auth_token] = - auth_token; - } - if ((*message_)[strings::msg_params].keyExists( - strings::cloud_transport_type)) { - smart_objects::SmartObject transport_type = - (*message_)[strings::msg_params][strings::cloud_transport_type]; - cloud_app_properties[strings::msg_params][strings::cloud_transport_type] = - transport_type; - } - if ((*message_)[strings::msg_params].keyExists( - strings::hybrid_app_preference)) { - smart_objects::SmartObject hybrid_app_preference = - (*message_)[strings::msg_params][strings::hybrid_app_preference]; - cloud_app_properties[strings::msg_params][strings::hybrid_app_preference] = - hybrid_app_preference; - } - - policy_handler_.OnSetCloudAppProperties(cloud_app_properties); + policy_handler_.OnSetCloudAppProperties(*message_); SendResponse(true, mobile_apis::Result::SUCCESS); } -- cgit v1.2.1 From 1d1d4325b5ded10c53bfc314acd9b65d0d336d10 Mon Sep 17 00:00:00 2001 From: ShobhitAd Date: Tue, 20 Nov 2018 11:08:49 -0500 Subject: Style fix in MOBILE_API --- src/components/interfaces/MOBILE_API.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml index 1707f65bad..714399bce6 100644 --- a/src/components/interfaces/MOBILE_API.xml +++ b/src/components/interfaces/MOBILE_API.xml @@ -547,9 +547,9 @@ Enumeration for the user's preference of which app type to use when both are available - - - + + + -- cgit v1.2.1 From 0eb0f386f0cc43a1497b569d27415d775ea40ab5 Mon Sep 17 00:00:00 2001 From: ShobhitAd Date: Tue, 13 Nov 2018 10:10:53 -0500 Subject: Implement new RPC in MOBILE_API --- src/components/interfaces/MOBILE_API.xml | 53 ++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml index 6ed42c3588..1707f65bad 100644 --- a/src/components/interfaces/MOBILE_API.xml +++ b/src/components/interfaces/MOBILE_API.xml @@ -545,6 +545,13 @@ + + Enumeration for the user's preference of which app type to use when both are available + + + + + Defines the hard (physical) and soft (touchscreen) buttons available from the module @@ -2609,6 +2616,7 @@ + -- cgit v1.2.1 From 1669b8e19869bbdcee2702a13c9e04ff94e649b5 Mon Sep 17 00:00:00 2001 From: ShobhitAd Date: Tue, 13 Nov 2018 10:36:42 -0500 Subject: Implement SetCloudAppProperties RPC in core --- .../mobile/set_cloudapp_properties_request.h | 28 +++++++++ .../mobile/set_cloudapp_properties_response.h | 28 +++++++++ .../mobile/set_cloudapp_properties_request.cc | 71 ++++++++++++++++++++++ .../mobile/set_cloudapp_properties_response.cc | 32 ++++++++++ .../sdl_rpc_plugin/src/mobile_command_factory.cc | 7 +++ 5 files changed, 166 insertions(+) create mode 100644 src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_cloudapp_properties_request.h create mode 100644 src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_cloudapp_properties_response.h create mode 100644 src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloudapp_properties_request.cc create mode 100644 src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloudapp_properties_response.cc diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_cloudapp_properties_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_cloudapp_properties_request.h new file mode 100644 index 0000000000..fc131020a8 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_cloudapp_properties_request.h @@ -0,0 +1,28 @@ +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_CLOUDAPP_PROPERTIES_REQUEST_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_CLOUDAPP_PROPERTIES_REQUEST_H_ + +#include "application_manager/commands/command_request_impl.h" + +namespace sdl_rpc_plugin { +namespace app_mngr = application_manager; + +namespace commands{ + +class SetCloudAppPropertiesRequest : public app_mngr::commands::CommandRequestImpl{ +public: + SetCloudAppPropertiesRequest(const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler); + virtual ~SetCloudAppPropertiesRequest(); + virtual void Run(); + virtual void on_event(const app_mngr::event_engine::Event& event); + private: + DISALLOW_COPY_AND_ASSIGN(SetCloudAppPropertiesRequest); +}; // SetCloudAppPropertiesRequest + +} // namespace commands +} // namespace sdl_rpc_plugin + +#endif //SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_CLOUDAPP_PROPERTIES_REQUEST_H_ \ No newline at end of file diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_cloudapp_properties_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_cloudapp_properties_response.h new file mode 100644 index 0000000000..aae45c52ce --- /dev/null +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_cloudapp_properties_response.h @@ -0,0 +1,28 @@ +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_CLOUDAPP_PROPERTIES_RESPONSE_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_CLOUDAPP_PROPERTIES_RESPONSE_H_ + +#include "application_manager/commands/command_response_impl.h" + +namespace sdl_rpc_plugin { +namespace app_mngr = application_manager; + +namespace commands { + +class SetCloudAppPropertiesResponse : public app_mngr::commands::CommandResponseImpl{ +public: + SetCloudAppPropertiesResponse(const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler); + virtual ~SetCloudAppPropertiesResponse(); + virtual void Run(); + private: + DISALLOW_COPY_AND_ASSIGN(SetCloudAppPropertiesResponse); + +}; //SetCloudAppPropertiesResponse + +} // namespace commands +} // namespace sdl_rpc_plugin + +#endif //SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_CLOUDAPP_PROPERTIES_RESPONSE_H_ \ No newline at end of file diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloudapp_properties_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloudapp_properties_request.cc new file mode 100644 index 0000000000..b5c66e4400 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloudapp_properties_request.cc @@ -0,0 +1,71 @@ +#include "sdl_rpc_plugin/commands/mobile/set_cloudapp_properties_request.h" + +namespace sdl_rpc_plugin { +using namespace application_manager; + +namespace commands { + + SetCloudAppPropertiesRequest::SetCloudAppPropertiesRequest(const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : CommandRequestImpl(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handler){} + + SetCloudAppPropertiesRequest::~SetCloudAppPropertiesRequest(){} + void SetCloudAppPropertiesRequest::Run(){ + LOG4CXX_AUTO_TRACE(logger_); + ApplicationSharedPtr app = application_manager_.application(connection_key()); + + if (!app) { + LOG4CXX_ERROR(logger_, "Application is not registered"); + SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); + return; + } + + if ((*message_)[strings::msg_params].empty()) { + LOG4CXX_ERROR(logger_, strings::msg_params << " is empty."); + SendResponse(false, mobile_apis::Result::INVALID_DATA); + return; + } + + smart_objects::SmartObject cloudapp_properties(smart_objects::SmartType_Map); + + cloudapp_properties[strings::msg_params][strings::app_name] = (*message_)[strings::msg_params][strings::app_name]; + cloudapp_properties[strings::msg_params][strings::app_id] = (*message_)[strings::msg_params][strings::app_id]; + + if ((*message_)[strings::msg_params].keyExists(strings::enabled)) { + smart_objects::SmartObject enabled = (*message_)[strings::msg_params][strings::enabled]; + cloudapp_properties[strings::msg_params][strings::enabled] = enabled; + } + if ((*message_)[strings::msg_params].keyExists(strings::cloud_app_auth_token)) { + smart_objects::SmartObject auth_token = (*message_)[strings::msg_params][strings::cloud_app_auth_token]; + cloudapp_properties[strings::msg_params][strings::cloud_app_auth_token] = auth_token; + } + if ((*message_)[strings::msg_params].keyExists(strings::cloud_transport_type)) { + smart_objects::SmartObject transport_type = (*message_)[strings::msg_params][strings::cloud_transport_type]; + cloudapp_properties[strings::msg_params][strings::cloud_transport_type] = transport_type; + } + if ((*message_)[strings::msg_params].keyExists(strings::hybrid_app_preference)) { + smart_objects::SmartObject hybrid_app_preference = (*message_)[strings::msg_params][strings::hybrid_app_preference]; + cloudapp_properties[strings::msg_params][strings::hybrid_app_preference] = hybrid_app_preference; + } + + policy_handler_.OnSetCloudAppProperties(cloudapp_properties); + SendResponse(true, mobile_apis::Result::SUCCESS); + + + } + + + void SetCloudAppPropertiesRequest::on_event(const app_mngr::event_engine::Event& event){ + LOG4CXX_INFO(logger_, "SetCloudAppPropertiesRequest on_event"); + } + + +} // namespace commands +} // namespace sdl_rpc_plugin \ No newline at end of file diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloudapp_properties_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloudapp_properties_response.cc new file mode 100644 index 0000000000..b113f84131 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloudapp_properties_response.cc @@ -0,0 +1,32 @@ +#include "application_manager/application_manager.h" +#include "application_manager/rpc_service.h" +#include "sdl_rpc_plugin/commands/mobile/set_cloudapp_properties_response.h" + + +namespace sdl_rpc_plugin { +using namespace application_manager; + +namespace commands { + + SetCloudAppPropertiesResponse::SetCloudAppPropertiesResponse(const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : CommandResponseImpl(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handler){} + + + SetCloudAppPropertiesResponse::~SetCloudAppPropertiesResponse(){} + + void SetCloudAppPropertiesResponse::Run(){ + LOG4CXX_AUTO_TRACE(logger_); + + rpc_service_.SendMessageToMobile(message_); + } + +} // namespace commands +} //namespace sdl_rpc_plugins diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc index 5207c7e432..a5b3bf71fe 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc @@ -124,6 +124,8 @@ #include "sdl_rpc_plugin/commands/mobile/dial_number_response.h" #include "sdl_rpc_plugin/commands/mobile/send_haptic_data_request.h" #include "sdl_rpc_plugin/commands/mobile/send_haptic_data_response.h" +#include "sdl_rpc_plugin/commands/mobile/set_cloudapp_properties_request.h" +#include "sdl_rpc_plugin/commands/mobile/set_cloudapp_properties_response.h" #include "interfaces/MOBILE_API.h" CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationManager") @@ -337,6 +339,11 @@ CommandCreator& MobileCommandFactory::get_creator_factory( ? factory.GetCreator() : factory.GetCreator(); } + case mobile_apis::FunctionID::SetCloudAppPropertiesID: { + return mobile_api::messageType::request == message_type + ? factory.GetCreator() + : factory.GetCreator(); + } case mobile_apis::FunctionID::OnButtonEventID: { return factory.GetCreator(); } -- cgit v1.2.1 From 5d16aa31477d0835da6bcd3668f53ae0bd0d1439 Mon Sep 17 00:00:00 2001 From: ShobhitAd Date: Tue, 13 Nov 2018 11:08:06 -0500 Subject: Implement RPC in regular and external policies --- src/appMain/sdl_preloaded_pt.json | 41 ++++++++++++++++++++++ .../include/policy/policy_table/enums.h | 5 +++ .../policy_external/src/policy_table/enums.cc | 5 +++ .../include/policy/policy_table/enums.h | 5 +++ .../policy_regular/src/policy_table/enums.cc | 8 +++++ 5 files changed, 64 insertions(+) diff --git a/src/appMain/sdl_preloaded_pt.json b/src/appMain/sdl_preloaded_pt.json index 8a75cd3dab..3c84fc96bd 100644 --- a/src/appMain/sdl_preloaded_pt.json +++ b/src/appMain/sdl_preloaded_pt.json @@ -533,6 +533,47 @@ } } }, + "CloudApp":{ + "rpcs":{ + "SetCloudAppProperties":{ + "hmi_levels":["BACKGROUND", + "FULL", + "LIMITED"] + }, + "GetVehicleData": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"], + "parameters": [ + "cloudAppVehicleID" + ] + }, + "OnVehicleData": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"], + "parameters": [ + "cloudAppVehicleID" + ] + }, + "SubscribeVehicleData": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"], + "parameters": [ + "cloudAppVehicleID" + ] + }, + "UnsubscribeVehicleData": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"], + "parameters": [ + "cloudAppVehicleID" + ] + } + } + }, "RemoteControl": { "rpcs": { "ButtonPress": { 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 dc2fdab2fa..982118a43a 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 @@ -440,6 +440,11 @@ enum FunctionID { */ SendHapticDataID = 49, + /** + * @brief SetCloudAppPropertiesID. + */ + SetCloudAppPropertiesID = 50, + /** * @brief OnHMIStatusID. */ 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 48ce4d4f72..fac3cb86a1 100644 --- a/src/components/policy/policy_external/src/policy_table/enums.cc +++ b/src/components/policy/policy_external/src/policy_table/enums.cc @@ -1120,6 +1120,11 @@ bool EnumFromJsonString(const std::string& literal, FunctionID* result) { *result = SendHapticDataID; return true; } + + if("SetCloudAppProperties" == literal){ + *result = SetCloudAppPropertiesID; + return true; + } if ("OnHMIStatus" == literal) { *result = OnHMIStatusID; 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 fce6b7b865..563e822a36 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 @@ -426,6 +426,11 @@ enum FunctionID { */ SendHapticDataID = 49, + /** + * @brief SetCloudAppPropertiesID. + */ + SetCloudAppPropertiesID = 50, + /** * @brief OnHMIStatusID. */ 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 2ddf74af7e..0bc0bee954 100644 --- a/src/components/policy/policy_regular/src/policy_table/enums.cc +++ b/src/components/policy/policy_regular/src/policy_table/enums.cc @@ -847,6 +847,8 @@ bool IsValidEnum(FunctionID val) { return true; case SendHapticDataID: return true; + case SetCloudAppPropertiesID: + return true; case OnHMIStatusID: return true; case OnAppInterfaceUnregisteredID: @@ -994,6 +996,8 @@ const char* EnumToJsonString(FunctionID val) { return "GetSystemCapability"; case SendHapticDataID: return "SendHapticData"; + case SetCloudAppPropertiesID: + return "SetCloudAppProperties"; case OnHMIStatusID: return "OnHMIStatus"; case OnAppInterfaceUnregisteredID: @@ -1283,6 +1287,10 @@ bool EnumFromJsonString(const std::string& literal, FunctionID* result) { *result = SendHapticDataID; return true; } + if("SetCloudAppProperties" == literal){ + *result = SetCloudAppPropertiesID; + return true; + } if ("OnHMIStatus" == literal) { *result = OnHMIStatusID; -- cgit v1.2.1 From 4391bd0909caecbf640fba21769c32f415699f18 Mon Sep 17 00:00:00 2001 From: ShobhitAd Date: Tue, 13 Nov 2018 12:07:45 -0500 Subject: Getting HybridAppPreference from enum --- .../application_manager/src/policies/policy_handler.cc | 11 +++++++---- .../smart_objects/include/smart_objects/enum_schema_item.h | 7 +++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc index 505f29e13b..8e74ae99b9 100644 --- a/src/components/application_manager/src/policies/policy_handler.cc +++ b/src/components/application_manager/src/policies/policy_handler.cc @@ -54,6 +54,7 @@ #include "interfaces/MOBILE_API.h" #include "utils/file_system.h" #include "utils/scope_guard.h" +#include "smart_objects/enum_schema_item.h" #include "utils/helpers.h" #include "policy/policy_manager.h" @@ -1918,10 +1919,12 @@ void PolicyHandler::OnSetCloudAppProperties( policy_app_id, msg_params[strings::cloud_transport_type].asString()); } if (msg_params.keyExists(strings::hybrid_app_preference)) { - // const std::string hybrid_app_preference = - // EnumConversionHelper::EnumToString(msg_params[strings::hybrid_app_preference]); - // policy_manager_->SetHybridAppPreference( - // policy_app_id, hybrid_app_preference); + std::string hybrid_app_preference; + + mobile_apis::HybridAppPreference::eType value = static_cast + (msg_params[strings::hybrid_app_preference].asUInt()); + smart_objects::EnumConversionHelper::EnumToString(value, &hybrid_app_preference); + policy_manager_->SetHybridAppPreference(policy_app_id, hybrid_app_preference); } } diff --git a/src/components/smart_objects/include/smart_objects/enum_schema_item.h b/src/components/smart_objects/include/smart_objects/enum_schema_item.h index cbba5bd7cd..942b491927 100644 --- a/src/components/smart_objects/include/smart_objects/enum_schema_item.h +++ b/src/components/smart_objects/include/smart_objects/enum_schema_item.h @@ -220,11 +220,10 @@ class EnumConversionHelper { static bool EnumToString(const EnumType value, std::string* str) { const char* cstr; - if (EnumToCString(value, &cstr)) { - return false; - } - if (str) { + bool success = EnumToCString(value, &cstr); + if (success && str) { *str = cstr; + return true; } return false; } -- cgit v1.2.1 From ef15358324149bb3c1d278524f9690ce572336c7 Mon Sep 17 00:00:00 2001 From: ShobhitAd Date: Tue, 13 Nov 2018 12:13:32 -0500 Subject: Style Fix --- .../mobile/set_cloudapp_properties_request.h | 37 ++++--- .../mobile/set_cloudapp_properties_response.h | 31 +++--- .../mobile/set_cloudapp_properties_request.cc | 120 +++++++++++---------- .../mobile/set_cloudapp_properties_response.cc | 31 +++--- .../sdl_rpc_plugin/src/mobile_command_factory.cc | 5 +- .../src/policies/policy_handler.cc | 14 ++- .../include/policy/policy_table/enums.h | 2 +- .../policy_external/src/policy_table/enums.cc | 4 +- .../policy_regular/src/policy_table/enums.cc | 4 +- 9 files changed, 134 insertions(+), 114 deletions(-) diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_cloudapp_properties_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_cloudapp_properties_request.h index fc131020a8..0c62b248b4 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_cloudapp_properties_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_cloudapp_properties_request.h @@ -5,24 +5,27 @@ namespace sdl_rpc_plugin { namespace app_mngr = application_manager; - -namespace commands{ -class SetCloudAppPropertiesRequest : public app_mngr::commands::CommandRequestImpl{ -public: - SetCloudAppPropertiesRequest(const app_mngr::commands::MessageSharedPtr& message, - app_mngr::ApplicationManager& application_manager, - app_mngr::rpc_service::RPCService& rpc_service, - app_mngr::HMICapabilities& hmi_capabilities, - policy::PolicyHandlerInterface& policy_handler); - virtual ~SetCloudAppPropertiesRequest(); - virtual void Run(); - virtual void on_event(const app_mngr::event_engine::Event& event); +namespace commands { + +class SetCloudAppPropertiesRequest + : public app_mngr::commands::CommandRequestImpl { + public: + SetCloudAppPropertiesRequest( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler); + virtual ~SetCloudAppPropertiesRequest(); + virtual void Run(); + virtual void on_event(const app_mngr::event_engine::Event& event); + private: - DISALLOW_COPY_AND_ASSIGN(SetCloudAppPropertiesRequest); -}; // SetCloudAppPropertiesRequest + DISALLOW_COPY_AND_ASSIGN(SetCloudAppPropertiesRequest); +}; // SetCloudAppPropertiesRequest -} // namespace commands -} // namespace sdl_rpc_plugin +} // namespace commands +} // namespace sdl_rpc_plugin -#endif //SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_CLOUDAPP_PROPERTIES_REQUEST_H_ \ No newline at end of file +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_CLOUDAPP_PROPERTIES_REQUEST_H_ \ No newline at end of file diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_cloudapp_properties_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_cloudapp_properties_response.h index aae45c52ce..9037cb3b73 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_cloudapp_properties_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_cloudapp_properties_response.h @@ -8,21 +8,24 @@ namespace app_mngr = application_manager; namespace commands { -class SetCloudAppPropertiesResponse : public app_mngr::commands::CommandResponseImpl{ -public: - SetCloudAppPropertiesResponse(const app_mngr::commands::MessageSharedPtr& message, - app_mngr::ApplicationManager& application_manager, - app_mngr::rpc_service::RPCService& rpc_service, - app_mngr::HMICapabilities& hmi_capabilities, - policy::PolicyHandlerInterface& policy_handler); - virtual ~SetCloudAppPropertiesResponse(); - virtual void Run(); +class SetCloudAppPropertiesResponse + : public app_mngr::commands::CommandResponseImpl { + public: + SetCloudAppPropertiesResponse( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler); + virtual ~SetCloudAppPropertiesResponse(); + virtual void Run(); + private: DISALLOW_COPY_AND_ASSIGN(SetCloudAppPropertiesResponse); - -}; //SetCloudAppPropertiesResponse -} // namespace commands -} // namespace sdl_rpc_plugin +}; // SetCloudAppPropertiesResponse + +} // namespace commands +} // namespace sdl_rpc_plugin -#endif //SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_CLOUDAPP_PROPERTIES_RESPONSE_H_ \ No newline at end of file +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_CLOUDAPP_PROPERTIES_RESPONSE_H_ \ No newline at end of file diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloudapp_properties_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloudapp_properties_request.cc index b5c66e4400..49cb7029c7 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloudapp_properties_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloudapp_properties_request.cc @@ -5,67 +5,77 @@ using namespace application_manager; namespace commands { - SetCloudAppPropertiesRequest::SetCloudAppPropertiesRequest(const app_mngr::commands::MessageSharedPtr& message, - app_mngr::ApplicationManager& application_manager, - app_mngr::rpc_service::RPCService& rpc_service, - app_mngr::HMICapabilities& hmi_capabilities, - policy::PolicyHandlerInterface& policy_handler) - : CommandRequestImpl(message, - application_manager, - rpc_service, - hmi_capabilities, - policy_handler){} +SetCloudAppPropertiesRequest::SetCloudAppPropertiesRequest( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : CommandRequestImpl(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handler) {} - SetCloudAppPropertiesRequest::~SetCloudAppPropertiesRequest(){} - void SetCloudAppPropertiesRequest::Run(){ - LOG4CXX_AUTO_TRACE(logger_); - ApplicationSharedPtr app = application_manager_.application(connection_key()); +SetCloudAppPropertiesRequest::~SetCloudAppPropertiesRequest() {} +void SetCloudAppPropertiesRequest::Run() { + LOG4CXX_AUTO_TRACE(logger_); + ApplicationSharedPtr app = application_manager_.application(connection_key()); - if (!app) { - LOG4CXX_ERROR(logger_, "Application is not registered"); - SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); - return; - } + if (!app) { + LOG4CXX_ERROR(logger_, "Application is not registered"); + SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); + return; + } - if ((*message_)[strings::msg_params].empty()) { - LOG4CXX_ERROR(logger_, strings::msg_params << " is empty."); - SendResponse(false, mobile_apis::Result::INVALID_DATA); - return; - } + if ((*message_)[strings::msg_params].empty()) { + LOG4CXX_ERROR(logger_, strings::msg_params << " is empty."); + SendResponse(false, mobile_apis::Result::INVALID_DATA); + return; + } - smart_objects::SmartObject cloudapp_properties(smart_objects::SmartType_Map); + smart_objects::SmartObject cloudapp_properties(smart_objects::SmartType_Map); - cloudapp_properties[strings::msg_params][strings::app_name] = (*message_)[strings::msg_params][strings::app_name]; - cloudapp_properties[strings::msg_params][strings::app_id] = (*message_)[strings::msg_params][strings::app_id]; - - if ((*message_)[strings::msg_params].keyExists(strings::enabled)) { - smart_objects::SmartObject enabled = (*message_)[strings::msg_params][strings::enabled]; - cloudapp_properties[strings::msg_params][strings::enabled] = enabled; - } - if ((*message_)[strings::msg_params].keyExists(strings::cloud_app_auth_token)) { - smart_objects::SmartObject auth_token = (*message_)[strings::msg_params][strings::cloud_app_auth_token]; - cloudapp_properties[strings::msg_params][strings::cloud_app_auth_token] = auth_token; - } - if ((*message_)[strings::msg_params].keyExists(strings::cloud_transport_type)) { - smart_objects::SmartObject transport_type = (*message_)[strings::msg_params][strings::cloud_transport_type]; - cloudapp_properties[strings::msg_params][strings::cloud_transport_type] = transport_type; - } - if ((*message_)[strings::msg_params].keyExists(strings::hybrid_app_preference)) { - smart_objects::SmartObject hybrid_app_preference = (*message_)[strings::msg_params][strings::hybrid_app_preference]; - cloudapp_properties[strings::msg_params][strings::hybrid_app_preference] = hybrid_app_preference; - } - - policy_handler_.OnSetCloudAppProperties(cloudapp_properties); - SendResponse(true, mobile_apis::Result::SUCCESS); + cloudapp_properties[strings::msg_params][strings::app_name] = + (*message_)[strings::msg_params][strings::app_name]; + cloudapp_properties[strings::msg_params][strings::app_id] = + (*message_)[strings::msg_params][strings::app_id]; + if ((*message_)[strings::msg_params].keyExists(strings::enabled)) { + smart_objects::SmartObject enabled = + (*message_)[strings::msg_params][strings::enabled]; + cloudapp_properties[strings::msg_params][strings::enabled] = enabled; + } + if ((*message_)[strings::msg_params].keyExists( + strings::cloud_app_auth_token)) { + smart_objects::SmartObject auth_token = + (*message_)[strings::msg_params][strings::cloud_app_auth_token]; + cloudapp_properties[strings::msg_params][strings::cloud_app_auth_token] = + auth_token; + } + if ((*message_)[strings::msg_params].keyExists( + strings::cloud_transport_type)) { + smart_objects::SmartObject transport_type = + (*message_)[strings::msg_params][strings::cloud_transport_type]; + cloudapp_properties[strings::msg_params][strings::cloud_transport_type] = + transport_type; + } + if ((*message_)[strings::msg_params].keyExists( + strings::hybrid_app_preference)) { + smart_objects::SmartObject hybrid_app_preference = + (*message_)[strings::msg_params][strings::hybrid_app_preference]; + cloudapp_properties[strings::msg_params][strings::hybrid_app_preference] = + hybrid_app_preference; + } - } + policy_handler_.OnSetCloudAppProperties(cloudapp_properties); + SendResponse(true, mobile_apis::Result::SUCCESS); +} +void SetCloudAppPropertiesRequest::on_event( + const app_mngr::event_engine::Event& event) { + LOG4CXX_INFO(logger_, "SetCloudAppPropertiesRequest on_event"); +} - void SetCloudAppPropertiesRequest::on_event(const app_mngr::event_engine::Event& event){ - LOG4CXX_INFO(logger_, "SetCloudAppPropertiesRequest on_event"); - } - - -} // namespace commands -} // namespace sdl_rpc_plugin \ No newline at end of file +} // namespace commands +} // namespace sdl_rpc_plugin \ No newline at end of file diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloudapp_properties_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloudapp_properties_response.cc index b113f84131..6acfb2423d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloudapp_properties_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloudapp_properties_response.cc @@ -2,31 +2,30 @@ #include "application_manager/rpc_service.h" #include "sdl_rpc_plugin/commands/mobile/set_cloudapp_properties_response.h" - namespace sdl_rpc_plugin { using namespace application_manager; namespace commands { - SetCloudAppPropertiesResponse::SetCloudAppPropertiesResponse(const app_mngr::commands::MessageSharedPtr& message, - app_mngr::ApplicationManager& application_manager, - app_mngr::rpc_service::RPCService& rpc_service, - app_mngr::HMICapabilities& hmi_capabilities, - policy::PolicyHandlerInterface& policy_handler) - : CommandResponseImpl(message, +SetCloudAppPropertiesResponse::SetCloudAppPropertiesResponse( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : CommandResponseImpl(message, application_manager, rpc_service, hmi_capabilities, - policy_handler){} + policy_handler) {} +SetCloudAppPropertiesResponse::~SetCloudAppPropertiesResponse() {} - SetCloudAppPropertiesResponse::~SetCloudAppPropertiesResponse(){} +void SetCloudAppPropertiesResponse::Run() { + LOG4CXX_AUTO_TRACE(logger_); - void SetCloudAppPropertiesResponse::Run(){ - LOG4CXX_AUTO_TRACE(logger_); - - rpc_service_.SendMessageToMobile(message_); - } + rpc_service_.SendMessageToMobile(message_); +} -} // namespace commands -} //namespace sdl_rpc_plugins +} // namespace commands +} // namespace sdl_rpc_plugins diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc index a5b3bf71fe..dc5298813b 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc @@ -341,8 +341,9 @@ CommandCreator& MobileCommandFactory::get_creator_factory( } case mobile_apis::FunctionID::SetCloudAppPropertiesID: { return mobile_api::messageType::request == message_type - ? factory.GetCreator() - : factory.GetCreator(); + ? factory.GetCreator() + : factory + .GetCreator(); } case mobile_apis::FunctionID::OnButtonEventID: { return factory.GetCreator(); diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc index 8e74ae99b9..8c026c8c75 100644 --- a/src/components/application_manager/src/policies/policy_handler.cc +++ b/src/components/application_manager/src/policies/policy_handler.cc @@ -1920,11 +1920,15 @@ void PolicyHandler::OnSetCloudAppProperties( } if (msg_params.keyExists(strings::hybrid_app_preference)) { std::string hybrid_app_preference; - - mobile_apis::HybridAppPreference::eType value = static_cast - (msg_params[strings::hybrid_app_preference].asUInt()); - smart_objects::EnumConversionHelper::EnumToString(value, &hybrid_app_preference); - policy_manager_->SetHybridAppPreference(policy_app_id, hybrid_app_preference); + + mobile_apis::HybridAppPreference::eType value = + static_cast( + msg_params[strings::hybrid_app_preference].asUInt()); + smart_objects::EnumConversionHelper< + mobile_apis::HybridAppPreference::eType>:: + EnumToString(value, &hybrid_app_preference); + policy_manager_->SetHybridAppPreference(policy_app_id, + hybrid_app_preference); } } 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 982118a43a..5b494629bb 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 @@ -444,7 +444,7 @@ enum FunctionID { * @brief SetCloudAppPropertiesID. */ SetCloudAppPropertiesID = 50, - + /** * @brief OnHMIStatusID. */ 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 fac3cb86a1..d7d5a241de 100644 --- a/src/components/policy/policy_external/src/policy_table/enums.cc +++ b/src/components/policy/policy_external/src/policy_table/enums.cc @@ -1120,8 +1120,8 @@ bool EnumFromJsonString(const std::string& literal, FunctionID* result) { *result = SendHapticDataID; return true; } - - if("SetCloudAppProperties" == literal){ + + if ("SetCloudAppProperties" == literal) { *result = SetCloudAppPropertiesID; return true; } 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 0bc0bee954..91d0a6990f 100644 --- a/src/components/policy/policy_regular/src/policy_table/enums.cc +++ b/src/components/policy/policy_regular/src/policy_table/enums.cc @@ -848,7 +848,7 @@ bool IsValidEnum(FunctionID val) { case SendHapticDataID: return true; case SetCloudAppPropertiesID: - return true; + return true; case OnHMIStatusID: return true; case OnAppInterfaceUnregisteredID: @@ -1287,7 +1287,7 @@ bool EnumFromJsonString(const std::string& literal, FunctionID* result) { *result = SendHapticDataID; return true; } - if("SetCloudAppProperties" == literal){ + if ("SetCloudAppProperties" == literal) { *result = SetCloudAppPropertiesID; return true; } -- cgit v1.2.1 From e07013316897e2a7e9b0a12809ac084755a73d99 Mon Sep 17 00:00:00 2001 From: ShobhitAd Date: Wed, 14 Nov 2018 14:16:51 -0500 Subject: Made requested changes --- .../commands/mobile/set_cloudapp_properties_request.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloudapp_properties_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloudapp_properties_request.cc index 49cb7029c7..ca5a46e3dc 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloudapp_properties_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloudapp_properties_request.cc @@ -34,41 +34,41 @@ void SetCloudAppPropertiesRequest::Run() { return; } - smart_objects::SmartObject cloudapp_properties(smart_objects::SmartType_Map); + smart_objects::SmartObject cloud_app_properties(smart_objects::SmartType_Map); - cloudapp_properties[strings::msg_params][strings::app_name] = + cloud_app_properties[strings::msg_params][strings::app_name] = (*message_)[strings::msg_params][strings::app_name]; - cloudapp_properties[strings::msg_params][strings::app_id] = + cloud_app_properties[strings::msg_params][strings::app_id] = (*message_)[strings::msg_params][strings::app_id]; if ((*message_)[strings::msg_params].keyExists(strings::enabled)) { smart_objects::SmartObject enabled = (*message_)[strings::msg_params][strings::enabled]; - cloudapp_properties[strings::msg_params][strings::enabled] = enabled; + cloud_app_properties[strings::msg_params][strings::enabled] = enabled; } if ((*message_)[strings::msg_params].keyExists( strings::cloud_app_auth_token)) { smart_objects::SmartObject auth_token = (*message_)[strings::msg_params][strings::cloud_app_auth_token]; - cloudapp_properties[strings::msg_params][strings::cloud_app_auth_token] = + cloud_app_properties[strings::msg_params][strings::cloud_app_auth_token] = auth_token; } if ((*message_)[strings::msg_params].keyExists( strings::cloud_transport_type)) { smart_objects::SmartObject transport_type = (*message_)[strings::msg_params][strings::cloud_transport_type]; - cloudapp_properties[strings::msg_params][strings::cloud_transport_type] = + cloud_app_properties[strings::msg_params][strings::cloud_transport_type] = transport_type; } if ((*message_)[strings::msg_params].keyExists( strings::hybrid_app_preference)) { smart_objects::SmartObject hybrid_app_preference = (*message_)[strings::msg_params][strings::hybrid_app_preference]; - cloudapp_properties[strings::msg_params][strings::hybrid_app_preference] = + cloud_app_properties[strings::msg_params][strings::hybrid_app_preference] = hybrid_app_preference; } - policy_handler_.OnSetCloudAppProperties(cloudapp_properties); + policy_handler_.OnSetCloudAppProperties(cloud_app_properties); SendResponse(true, mobile_apis::Result::SUCCESS); } -- cgit v1.2.1 From ce76a8b072f3c11386534d823df530a6a826b514 Mon Sep 17 00:00:00 2001 From: ShobhitAd Date: Fri, 16 Nov 2018 16:35:50 -0500 Subject: Removed redundant smart object --- .../mobile/set_cloudapp_properties_request.cc | 37 ++-------------------- 1 file changed, 2 insertions(+), 35 deletions(-) diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloudapp_properties_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloudapp_properties_request.cc index ca5a46e3dc..d92f458587 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloudapp_properties_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloudapp_properties_request.cc @@ -18,6 +18,7 @@ SetCloudAppPropertiesRequest::SetCloudAppPropertiesRequest( policy_handler) {} SetCloudAppPropertiesRequest::~SetCloudAppPropertiesRequest() {} + void SetCloudAppPropertiesRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); ApplicationSharedPtr app = application_manager_.application(connection_key()); @@ -34,41 +35,7 @@ void SetCloudAppPropertiesRequest::Run() { return; } - smart_objects::SmartObject cloud_app_properties(smart_objects::SmartType_Map); - - cloud_app_properties[strings::msg_params][strings::app_name] = - (*message_)[strings::msg_params][strings::app_name]; - cloud_app_properties[strings::msg_params][strings::app_id] = - (*message_)[strings::msg_params][strings::app_id]; - - if ((*message_)[strings::msg_params].keyExists(strings::enabled)) { - smart_objects::SmartObject enabled = - (*message_)[strings::msg_params][strings::enabled]; - cloud_app_properties[strings::msg_params][strings::enabled] = enabled; - } - if ((*message_)[strings::msg_params].keyExists( - strings::cloud_app_auth_token)) { - smart_objects::SmartObject auth_token = - (*message_)[strings::msg_params][strings::cloud_app_auth_token]; - cloud_app_properties[strings::msg_params][strings::cloud_app_auth_token] = - auth_token; - } - if ((*message_)[strings::msg_params].keyExists( - strings::cloud_transport_type)) { - smart_objects::SmartObject transport_type = - (*message_)[strings::msg_params][strings::cloud_transport_type]; - cloud_app_properties[strings::msg_params][strings::cloud_transport_type] = - transport_type; - } - if ((*message_)[strings::msg_params].keyExists( - strings::hybrid_app_preference)) { - smart_objects::SmartObject hybrid_app_preference = - (*message_)[strings::msg_params][strings::hybrid_app_preference]; - cloud_app_properties[strings::msg_params][strings::hybrid_app_preference] = - hybrid_app_preference; - } - - policy_handler_.OnSetCloudAppProperties(cloud_app_properties); + policy_handler_.OnSetCloudAppProperties(*message_); SendResponse(true, mobile_apis::Result::SUCCESS); } -- cgit v1.2.1 From 27d02ac7c4b30c5fd0af3a455537d0b4b60a12f4 Mon Sep 17 00:00:00 2001 From: ShobhitAd Date: Tue, 20 Nov 2018 11:08:49 -0500 Subject: Style fix in MOBILE_API --- src/components/interfaces/MOBILE_API.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml index 1707f65bad..714399bce6 100644 --- a/src/components/interfaces/MOBILE_API.xml +++ b/src/components/interfaces/MOBILE_API.xml @@ -547,9 +547,9 @@ Enumeration for the user's preference of which app type to use when both are available - - - + + + -- cgit v1.2.1