diff options
author | Andrey Oleynik <aoleynik@luxoft.com> | 2015-06-03 11:55:46 +0300 |
---|---|---|
committer | Andrey Oleynik <aoleynik@luxoft.com> | 2015-06-03 11:55:46 +0300 |
commit | 78602638b569f6d9ab861edffeb4b40bf3d9f60b (patch) | |
tree | c02b4b16a0bbc382039ccf669a82b5290cd81438 | |
parent | ca8afd996ef8a3fd26c7a7ea497accedd92f20bc (diff) | |
download | smartdevicelink-78602638b569f6d9ab861edffeb4b40bf3d9f60b.tar.gz |
Made proper setting of preload flag for policy table after changes.
3 files changed, 16 insertions, 2 deletions
diff --git a/src/components/application_manager/src/commands/hmi/get_system_info_response.cc b/src/components/application_manager/src/commands/hmi/get_system_info_response.cc index 7cfd1b579..26b09d06d 100644 --- a/src/components/application_manager/src/commands/hmi/get_system_info_response.cc +++ b/src/components/application_manager/src/commands/hmi/get_system_info_response.cc @@ -52,6 +52,13 @@ void GetSystemInfoResponse::Run() { if (hmi_apis::Common_Result::SUCCESS != code) { LOG4CXX_WARN(logger_, "GetSystemError returns an error code " << code); + + // We have to set preloaded flag as false in policy table on any response + // of GetSystemInfo (SDLAQ-CRS-2365) + const std::string empty_value; + policy::PolicyHandler::instance()->OnGetSystemInfo(empty_value, + empty_value, + empty_value); return; } const std::string ccpu_version = diff --git a/src/components/policy/src/policy/src/cache_manager.cc b/src/components/policy/src/policy/src/cache_manager.cc index df6a73028..a145824a2 100644 --- a/src/components/policy/src/policy/src/cache_manager.cc +++ b/src/components/policy/src/policy/src/cache_manager.cc @@ -790,6 +790,11 @@ bool CacheManager::SetMetaInfo(const std::string &ccpu_version, const std::string &wers_country_code, const std::string &language) { CACHE_MANAGER_CHECK(false); + + // We have to set preloaded flag as false in policy table on any response + // of GetSystemInfo (SDLAQ-CRS-2365) + *pt_->policy_table.module_config.preloaded_pt = false; + Backup(); return true; } diff --git a/src/components/policy/src/policy/src/sql_pt_representation.cc b/src/components/policy/src/policy/src/sql_pt_representation.cc index a00282ef0..47eae02dd 100644 --- a/src/components/policy/src/policy/src/sql_pt_representation.cc +++ b/src/components/policy/src/policy/src/sql_pt_representation.cc @@ -1039,8 +1039,10 @@ bool SQLPTRepresentation::SaveModuleConfig( return false; } - config.preloaded_pt.is_initialized() ? - query.Bind(0, config.preloaded_pt) : query.Bind(0, false); + bool is_preloaded = config.preloaded_pt.is_initialized() && + *config.preloaded_pt; + + query.Bind(0, is_preloaded); query.Bind(1, config.exchange_after_x_ignition_cycles); query.Bind(2, config.exchange_after_x_kilometers); query.Bind(3, config.exchange_after_x_days); |