summaryrefslogtreecommitdiff
path: root/src/components/policy/policy_regular/src/cache_manager.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/policy/policy_regular/src/cache_manager.cc')
-rw-r--r--src/components/policy/policy_regular/src/cache_manager.cc22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/components/policy/policy_regular/src/cache_manager.cc b/src/components/policy/policy_regular/src/cache_manager.cc
index d53ec4d18a..d93af5b422 100644
--- a/src/components/policy/policy_regular/src/cache_manager.cc
+++ b/src/components/policy/policy_regular/src/cache_manager.cc
@@ -1337,6 +1337,8 @@ void CacheManager::PersistData() {
}
backup_->SetMetaInfo(*(*copy_pt.policy_table.module_meta).ccpu_version);
+ ex_backup_->SetHardwareVersion(
+ *(*copy_pt.policy_table.module_meta).hardware_version);
// In case of extended policy the meta info should be backuped as well.
backup_->WriteDb();
@@ -1490,13 +1492,33 @@ bool CacheManager::SetMetaInfo(const std::string& ccpu_version,
return true;
}
+void CacheManager::SetHardwareVersion(const std::string& hardware_version) {
+ SDL_LOG_AUTO_TRACE();
+ CACHE_MANAGER_CHECK_VOID();
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+
+ *pt_->policy_table.module_meta->hardware_version = hardware_version;
+ Backup();
+}
+
std::string CacheManager::GetCCPUVersionFromPT() const {
SDL_LOG_AUTO_TRACE();
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+
rpc::Optional<policy_table::ModuleMeta>& module_meta =
pt_->policy_table.module_meta;
return *(module_meta->ccpu_version);
}
+std::string CacheManager::GetHardwareVersionFromPT() const {
+ SDL_LOG_AUTO_TRACE();
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+
+ rpc::Optional<policy_table::ModuleMeta>& module_meta =
+ pt_->policy_table.module_meta;
+ return *(module_meta->hardware_version);
+}
+
bool CacheManager::IsMetaInfoPresent() const {
CACHE_MANAGER_CHECK(false);
bool result = true;