summaryrefslogtreecommitdiff
path: root/src/components/policy/policy_external/src/policy_manager_impl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/policy/policy_external/src/policy_manager_impl.cc')
-rw-r--r--src/components/policy/policy_external/src/policy_manager_impl.cc94
1 files changed, 94 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 a603f122e2..742435098e 100644
--- a/src/components/policy/policy_external/src/policy_manager_impl.cc
+++ b/src/components/policy/policy_external/src/policy_manager_impl.cc
@@ -271,6 +271,11 @@ std::string PolicyManagerImpl::GetLockScreenIconUrl() const {
return cache_->GetLockScreenIconUrl();
}
+std::string PolicyManagerImpl::GetIconUrl(
+ const std::string& policy_app_id) const {
+ return cache_->GetIconUrl(policy_app_id);
+}
+
/**
* @brief FilterInvalidFunctions filter functions that are absent in schema
* @param rpcs list of functions to filter
@@ -497,6 +502,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
@@ -725,6 +736,75 @@ const VehicleInfo PolicyManagerImpl::GetVehicleInfo() const {
return cache_->GetVehicleInfo();
}
+void PolicyManagerImpl::GetEnabledCloudApps(
+ std::vector<std::string>& enabled_apps) const {
+ cache_->GetEnabledCloudApps(enabled_apps);
+}
+
+bool 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,
+ enabled,
+ endpoint,
+ certificate,
+ auth_token,
+ cloud_transport_type,
+ 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);
+}
+
+void PolicyManagerImpl::SetAppAuthToken(const std::string& policy_app_id,
+ const std::string& auth_token) {
+ cache_->SetAppAuthToken(policy_app_id, auth_token);
+}
+
+void PolicyManagerImpl::SetAppCloudTransportType(
+ const std::string& policy_app_id, const std::string& cloud_transport_type) {
+ cache_->SetAppCloudTransportType(policy_app_id, cloud_transport_type);
+}
+
+void PolicyManagerImpl::SetAppEndpoint(const std::string& policy_app_id,
+ const std::string& endpoint) {
+ cache_->SetAppEndpoint(policy_app_id, endpoint);
+}
+
+void PolicyManagerImpl::SetAppNicknames(const std::string& policy_app_id,
+ const StringArray& nicknames) {
+ cache_->SetAppNicknames(policy_app_id, nicknames);
+}
+
+void PolicyManagerImpl::SetHybridAppPreference(
+ const std::string& policy_app_id,
+ const std::string& hybrid_app_preference) {
+ cache_->SetHybridAppPreference(policy_app_id, hybrid_app_preference);
+}
+
+void PolicyManagerImpl::GetAppServiceParameters(
+ const std::string& policy_app_id,
+ policy_table::AppServiceParameters* app_service_parameters) const {
+ cache_->GetAppServiceParameters(policy_app_id, app_service_parameters);
+}
+
+bool PolicyManagerImpl::UnknownRPCPassthroughAllowed(
+ const std::string& policy_app_id) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return cache_->UnknownRPCPassthroughAllowed(policy_app_id);
+}
+
void PolicyManagerImpl::CheckPermissions(const PTString& app_id,
const PTString& hmi_level,
const PTString& rpc,
@@ -2033,6 +2113,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;
}
@@ -2141,6 +2226,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 =