summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjacobkeeler <jacob.keeler@livioradio.com>2018-11-15 15:54:08 -0500
committerjacobkeeler <jacob.keeler@livioradio.com>2018-11-15 16:28:30 -0500
commit5f3cf62d06049b9ee64a75d205581914c4c90929 (patch)
treea63afef901ecf8f8103a031a5c9004ebb905fd4a
parentbf9a8789f419d054e2ad920725c2079f9d511c15 (diff)
downloadsdl_core-feature/cloud_app_policies.tar.gz
Address review commentsfeature/cloud_app_policies
-rw-r--r--src/components/application_manager/include/application_manager/policies/policy_handler.h21
-rw-r--r--src/components/application_manager/src/policies/policy_handler.cc33
-rw-r--r--src/components/include/application_manager/policies/policy_handler_interface.h9
-rw-r--r--src/components/include/policy/policy_external/policy/policy_manager.h9
-rw-r--r--src/components/include/policy/policy_regular/policy/policy_manager.h9
-rw-r--r--src/components/include/test/application_manager/policies/mock_policy_handler_interface.h15
-rw-r--r--src/components/include/test/policy/policy_external/policy/mock_cache_manager.h15
-rw-r--r--src/components/include/test/policy/policy_external/policy/mock_policy_manager.h15
-rw-r--r--src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h15
-rw-r--r--src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h15
-rw-r--r--src/components/policy/policy_external/include/policy/cache_manager.h20
-rw-r--r--src/components/policy/policy_external/include/policy/cache_manager_interface.h9
-rw-r--r--src/components/policy/policy_external/include/policy/policy_manager_impl.h20
-rw-r--r--src/components/policy/policy_external/src/cache_manager.cc12
-rw-r--r--src/components/policy/policy_external/src/policy_manager_impl.cc16
-rw-r--r--src/components/policy/policy_regular/include/policy/cache_manager.h20
-rw-r--r--src/components/policy/policy_regular/include/policy/cache_manager_interface.h9
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_manager_impl.h20
-rw-r--r--src/components/policy/policy_regular/src/cache_manager.cc6
-rw-r--r--src/components/policy/policy_regular/src/policy_manager_impl.cc16
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<std::string>& 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<std::string>& 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<std::string>& 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<std::string>& 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<std::string>& 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,