summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYana Chernysheva (GitHub) <59469418+ychernysheva@users.noreply.github.com>2020-03-02 16:37:48 +0200
committerGitHub <noreply@github.com>2020-03-02 09:37:48 -0500
commit1ccf4041c223286aeef9721956abacdf26160f23 (patch)
tree84272ae91f87bf46cbcb0fb90f91684b22b1463c
parentce12181630c0923cf821bfa314d46be02e5380bc (diff)
downloadsdl_core-1ccf4041c223286aeef9721956abacdf26160f23.tar.gz
Add function UnwrapAppPolicies to CacheManager::Init() method (#3244)
* Add function UnwrapAppPolicies to CacheManager::Init() method * Add UnwrapAppPolicies to external flow * Delete return after unsuccessful unwrapping * Make result variable independent from result of execution UnwrapAppPolicies * Add update for external flow * Fix style * Add changes to external flow (remove dependency from result) * Add newline
-rw-r--r--src/components/policy/policy_external/src/cache_manager.cc4
-rw-r--r--src/components/policy/policy_regular/src/cache_manager.cc5
2 files changed, 9 insertions, 0 deletions
diff --git a/src/components/policy/policy_external/src/cache_manager.cc b/src/components/policy/policy_external/src/cache_manager.cc
index a49d450a9e..70129e16d9 100644
--- a/src/components/policy/policy_external/src/cache_manager.cc
+++ b/src/components/policy/policy_external/src/cache_manager.cc
@@ -2649,6 +2649,10 @@ bool CacheManager::Init(const std::string& file_name,
LOG4CXX_DEBUG(logger_,
"Check if snapshot valid: " << std::boolalpha << result);
+ if (!UnwrapAppPolicies(pt_->policy_table.app_policies_section.apps)) {
+ LOG4CXX_ERROR(logger_, "Cannot unwrap application policies");
+ }
+
if (result) {
backup_->UpdateDBVersion();
Backup();
diff --git a/src/components/policy/policy_regular/src/cache_manager.cc b/src/components/policy/policy_regular/src/cache_manager.cc
index 7a6f98f536..738e62f1dc 100644
--- a/src/components/policy/policy_regular/src/cache_manager.cc
+++ b/src/components/policy/policy_regular/src/cache_manager.cc
@@ -53,6 +53,7 @@
#include "utils/threads/thread.h"
#include "utils/threads/thread_delegate.h"
+#include "policy/policy_helper.h"
#include "policy/sql_pt_representation.h"
namespace policy_table = rpc::policy_table_interface_base;
@@ -1816,6 +1817,10 @@ bool CacheManager::Init(const std::string& file_name,
return result;
}
+ if (!UnwrapAppPolicies(pt_->policy_table.app_policies_section.apps)) {
+ LOG4CXX_ERROR(logger_, "Cannot unwrap application policies");
+ }
+
backup_->UpdateDBVersion();
Backup();
} break;