summaryrefslogtreecommitdiff
path: root/src/components/policy/policy_external/src
diff options
context:
space:
mode:
authorjacobkeeler <jacob.keeler@livioradio.com>2019-02-25 11:33:34 -0500
committerjacobkeeler <jacob.keeler@livioradio.com>2019-02-26 10:41:15 -0500
commit146aa7a46a540cfd85a30f82bcec2783c9801ba7 (patch)
tree395136f7d4cf245c65d00b97e435e8fd41371376 /src/components/policy/policy_external/src
parent1f4a99fa5c7f8ad10645dc4c1a76469b83d53011 (diff)
downloadsdl_core-146aa7a46a540cfd85a30f82bcec2783c9801ba7.tar.gz
Add auth_token to StartServiceACK for cloud apps
Diffstat (limited to 'src/components/policy/policy_external/src')
-rw-r--r--src/components/policy/policy_external/src/policy_manager_impl.cc20
1 files changed, 20 insertions, 0 deletions
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 0844edd8eb..bd7746d720 100644
--- a/src/components/policy/policy_external/src/policy_manager_impl.cc
+++ b/src/components/policy/policy_external/src/policy_manager_impl.cc
@@ -497,6 +497,12 @@ bool PolicyManagerImpl::LoadPT(const std::string& file,
} else {
LOG4CXX_INFO(logger_, "app_hmi_types empty");
}
+
+ std::vector<std::string> enabled_apps;
+ cache_->GetEnabledCloudApps(enabled_apps);
+ for (auto it = enabled_apps.begin(); it != enabled_apps.end(); ++it) {
+ SendAuthTokenUpdated(*it);
+ }
}
// If there was a user request for policy table update, it should be started
@@ -2080,6 +2086,11 @@ bool PolicyManagerImpl::InitPT(const std::string& file_name,
const bool ret = cache_->Init(file_name, settings);
if (ret) {
RefreshRetrySequence();
+ std::vector<std::string> enabled_apps;
+ cache_->GetEnabledCloudApps(enabled_apps);
+ for (auto it = enabled_apps.begin(); it != enabled_apps.end(); ++it) {
+ SendAuthTokenUpdated(*it);
+ }
}
return ret;
}
@@ -2188,6 +2199,15 @@ void PolicyManagerImpl::SendAppPermissionsChanged(
listener()->OnPermissionsUpdated(application_id, notification_data);
}
+void PolicyManagerImpl::SendAuthTokenUpdated(const std::string policy_app_id) {
+ bool enabled = false;
+ std::string end, cert, ctt, hap;
+ std::string auth_token;
+ cache_->GetCloudAppParameters(
+ policy_app_id, enabled, end, cert, auth_token, ctt, hap);
+ listener_->OnAuthTokenUpdated(policy_app_id, auth_token);
+}
+
void PolicyManagerImpl::OnPrimaryGroupsChanged(
const std::string& application_id) {
const std::vector<std::string> devices =