diff options
author | JackLivio <jack@livio.io> | 2018-04-18 10:55:48 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-18 10:55:48 -0400 |
commit | 7f7fcbb998fb17f2954fd103349af67ea9b71a3f (patch) | |
tree | 55640424c5774fce04f01876fa1a4d281002c52e /src/components/policy | |
parent | 61fd83fed0dc584019b305bebc82512d2c42b9e7 (diff) | |
parent | 11ffe206ea3c114da3f45a5cbb9b23834d2996c8 (diff) | |
download | sdl_core-fix/check_transport_manager_init.tar.gz |
Merge pull request #2133 from smartdevicelink/release/4.5.14.5.1success,-HMI-show-radio-screenfix/check_transport_manager_initfeature/external_proprietary_policy
Release/4.5.1
Diffstat (limited to 'src/components/policy')
-rw-r--r-- | src/components/policy/policy_external/src/policy_manager_impl.cc | 24 | ||||
-rw-r--r-- | src/components/policy/policy_regular/src/policy_manager_impl.cc | 10 |
2 files changed, 22 insertions, 12 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 2cd0d2b23b..433a7a6bca 100644 --- a/src/components/policy/policy_external/src/policy_manager_impl.cc +++ b/src/components/policy/policy_external/src/policy_manager_impl.cc @@ -313,7 +313,10 @@ bool PolicyManagerImpl::LoadPT(const std::string& file, utils::SharedPtr<policy_table::Table> policy_table_snapshot = cache_->GenerateSnapshot(); if (!policy_table_snapshot) { - LOG4CXX_ERROR(logger_, "Failed to create snapshot of policy table"); + LOG4CXX_ERROR( + logger_, + "Failed to create snapshot of policy table, trying another exchange"); + ForcePTExchange(); return false; } @@ -327,7 +330,10 @@ bool PolicyManagerImpl::LoadPT(const std::string& file, // Replace current data with updated if (!cache_->ApplyUpdate(*pt_update)) { - LOG4CXX_WARN(logger_, "Unsuccessful save of updated policy table."); + LOG4CXX_WARN( + logger_, + "Unsuccessful save of updated policy table, trying another exchange"); + ForcePTExchange(); return false; } @@ -588,8 +594,7 @@ void PolicyManagerImpl::CheckPermissions(const PTString& app_id, policy_table::FunctionalGroupings functional_groupings; cache_->GetFunctionalGroupings(functional_groupings); - policy_table::Strings app_groups = - GetGroupsNames(app_group_permissions); + policy_table::Strings app_groups = GetGroupsNames(app_group_permissions); // Undefined groups (without user consent) disallowed by default, since // OnPermissionsChange notification has no "undefined" section @@ -621,8 +626,7 @@ void PolicyManagerImpl::CheckPermissions(const PTString& app_id, } const bool known_rpc = rpc_permissions.end() != rpc_permissions.find(rpc); - LOG4CXX_DEBUG(logger_, "Is known rpc " << - (known_rpc ? "true" : "false") ); + LOG4CXX_DEBUG(logger_, "Is known rpc " << (known_rpc ? "true" : "false")); if (!known_rpc) { // RPC not found in list == disallowed by backend result.hmi_level_permitted = kRpcDisallowed; @@ -644,7 +648,9 @@ void PolicyManagerImpl::CheckPermissions(const PTString& app_id, rpc_permissions[rpc].hmi_permissions[kUserDisallowedKey].find( hmi_level)) { // RPC found in allowed == allowed by backend, but disallowed by user - LOG4CXX_DEBUG(logger_, "RPC found in allowed == allowed by backend, but disallowed by user"); + LOG4CXX_DEBUG( + logger_, + "RPC found in allowed == allowed by backend, but disallowed by user"); result.hmi_level_permitted = kRpcUserDisallowed; } else { LOG4CXX_DEBUG(logger_, @@ -984,7 +990,6 @@ void PolicyManagerImpl::SetUserConsentForApp( const PermissionConsent& permissions, const NotificationMode mode) { LOG4CXX_AUTO_TRACE(logger_); - cache_->ResetCalculatedPermissions(); PermissionConsent verified_permissions = EnsureCorrectPermissionConsent(permissions); @@ -1569,8 +1574,7 @@ void PolicyManagerImpl::OnUpdateStarted() { uint32_t update_timeout = TimeoutExchangeMSec(); LOG4CXX_DEBUG(logger_, "Update timeout will be set to (milisec): " << update_timeout); - send_on_update_sent_out_ = - !wrong_ptu_update_received_ && !update_status_manager_.IsUpdatePending(); + send_on_update_sent_out_ = !update_status_manager_.IsUpdatePending(); if (send_on_update_sent_out_) { update_status_manager_.OnUpdateSentOut(update_timeout); diff --git a/src/components/policy/policy_regular/src/policy_manager_impl.cc b/src/components/policy/policy_regular/src/policy_manager_impl.cc index 39b303cbb5..3e08147a4c 100644 --- a/src/components/policy/policy_regular/src/policy_manager_impl.cc +++ b/src/components/policy/policy_regular/src/policy_manager_impl.cc @@ -196,7 +196,10 @@ bool PolicyManagerImpl::LoadPT(const std::string& file, utils::SharedPtr<policy_table::Table> policy_table_snapshot = cache_->GenerateSnapshot(); if (!policy_table_snapshot) { - LOG4CXX_ERROR(logger_, "Failed to create snapshot of policy table"); + LOG4CXX_ERROR( + logger_, + "Failed to create snapshot of policy table, trying another exchange"); + ForcePTExchange(); return false; } @@ -209,7 +212,10 @@ bool PolicyManagerImpl::LoadPT(const std::string& file, // Replace current data with updated if (!cache_->ApplyUpdate(*pt_update)) { - LOG4CXX_WARN(logger_, "Unsuccessful save of updated policy table."); + LOG4CXX_WARN( + logger_, + "Unsuccessful save of updated policy table, trying another exchange"); + ForcePTExchange(); return false; } |