summaryrefslogtreecommitdiff
path: root/src/components/application_manager
diff options
context:
space:
mode:
authorjacobkeeler <jacob.keeler@livioradio.com>2018-12-03 10:42:42 -0500
committerjacobkeeler <jacob.keeler@livioradio.com>2018-12-03 10:42:42 -0500
commit81884995825b0da78eb676d77b301b2467700c30 (patch)
treef53c464ba09953adac0185eb70eb3aa8bbe59177 /src/components/application_manager
parent712440a5b5592ff447e8f9107d7c749e02b52cd4 (diff)
parenta751881e1f4e04a6af24552be70d691d8076c933 (diff)
downloadsdl_core-81884995825b0da78eb676d77b301b2467700c30.tar.gz
Merge remote-tracking branch 'origin/feature/cloud_app_transport' into feature/cloud_app_connection_status
Diffstat (limited to 'src/components/application_manager')
-rw-r--r--src/components/application_manager/include/application_manager/policies/policy_handler.h21
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloudapp_properties_request.cc2
-rw-r--r--src/components/application_manager/src/policies/policy_handler.cc36
3 files changed, 34 insertions, 25 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/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..0beb7631c7 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());
@@ -69,6 +70,7 @@ void SetCloudAppPropertiesRequest::Run() {
}
policy_handler_.OnSetCloudAppProperties(cloud_app_properties);
+
SendResponse(true, mobile_apis::Result::SUCCESS);
}
diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc
index 8c6de5482c..c603659353 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(
@@ -1901,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());