diff options
Diffstat (limited to 'src/components/policy/policy_external/src/cache_manager.cc')
-rw-r--r-- | src/components/policy/policy_external/src/cache_manager.cc | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/src/components/policy/policy_external/src/cache_manager.cc b/src/components/policy/policy_external/src/cache_manager.cc index bd38f7bf8f..4170e7aaa6 100644 --- a/src/components/policy/policy_external/src/cache_manager.cc +++ b/src/components/policy/policy_external/src/cache_manager.cc @@ -1561,10 +1561,44 @@ bool CacheManager::UnknownRPCPassthroughAllowed( return false; } +const boost::optional<bool> CacheManager::LockScreenDismissalEnabledState() + const { + boost::optional<bool> empty; + CACHE_MANAGER_CHECK(empty); + sync_primitives::AutoLock auto_lock(cache_lock_); + policy_table::ModuleConfig& module_config = pt_->policy_table.module_config; + if (module_config.lock_screen_dismissal_enabled.is_initialized()) { + return boost::optional<bool>(*module_config.lock_screen_dismissal_enabled); + } + return empty; +} + +const boost::optional<std::string> +CacheManager::LockScreenDismissalWarningMessage( + const std::string& language) const { + LOG4CXX_AUTO_TRACE(logger_); + boost::optional<std::string> empty; + CACHE_MANAGER_CHECK(empty); + + const std::string lock_screen_dismissal_warning_message = + "LockScreenDismissalWarning"; + sync_primitives::AutoLock auto_lock(cache_lock_); + + std::vector<std::string> msg_codes{lock_screen_dismissal_warning_message}; + + const auto messages = GetUserFriendlyMsg(msg_codes, language, "en-us"); + + if (messages.empty() || messages[0].text_body.empty()) { + return empty; + } + + return boost::optional<std::string>(messages[0].text_body); +} + std::vector<UserFriendlyMessage> CacheManager::GetUserFriendlyMsg( const std::vector<std::string>& msg_codes, const std::string& language, - const std::string& active_hmi_language) { + const std::string& active_hmi_language) const { LOG4CXX_AUTO_TRACE(logger_); std::vector<UserFriendlyMessage> result; CACHE_MANAGER_CHECK(result); |