summaryrefslogtreecommitdiff
path: root/src/components/policy/policy_regular
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/policy/policy_regular')
-rw-r--r--src/components/policy/policy_regular/include/policy/cache_manager.h18
-rw-r--r--src/components/policy/policy_regular/include/policy/cache_manager_interface.h9
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_helper.h3
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_manager_impl.h3
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_table/enums.h1
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_types.h4
-rw-r--r--src/components/policy/policy_regular/src/cache_manager.cc115
-rw-r--r--src/components/policy/policy_regular/src/policy_helper.cc28
-rw-r--r--src/components/policy/policy_regular/src/policy_manager_impl.cc18
-rw-r--r--src/components/policy/policy_regular/src/policy_table/enums.cc8
-rw-r--r--src/components/policy/policy_regular/src/policy_table/types.cc85
-rw-r--r--src/components/policy/policy_regular/src/sql_pt_queries.cc32
-rw-r--r--src/components/policy/policy_regular/src/sql_pt_representation.cc67
-rw-r--r--src/components/policy/policy_regular/test/PTU.json2
-rw-r--r--src/components/policy/policy_regular/test/PTU2.json2
-rw-r--r--src/components/policy/policy_regular/test/PTU3.json2
-rw-r--r--src/components/policy/policy_regular/test/PTU4.json2
-rw-r--r--src/components/policy/policy_regular/test/policy_manager_impl_test.cc2
-rw-r--r--src/components/policy/policy_regular/test/ptu2_requestType.json6
-rw-r--r--src/components/policy/policy_regular/test/ptu_requestType.json6
-rw-r--r--src/components/policy/policy_regular/test/sdl_preloaded_pt.json2
-rw-r--r--src/components/policy/policy_regular/test/sdl_pt_first_update.json4
-rw-r--r--src/components/policy/policy_regular/test/sdl_pt_second_update.json4
-rw-r--r--src/components/policy/policy_regular/test/sdl_pt_update.json4
-rw-r--r--src/components/policy/policy_regular/test/valid_sdl_pt_update.json4
25 files changed, 350 insertions, 81 deletions
diff --git a/src/components/policy/policy_regular/include/policy/cache_manager.h b/src/components/policy/policy_regular/include/policy/cache_manager.h
index c5d4c848f4..8c0acd44d2 100644
--- a/src/components/policy/policy_regular/include/policy/cache_manager.h
+++ b/src/components/policy/policy_regular/include/policy/cache_manager.h
@@ -701,6 +701,15 @@ class CacheManager : public CacheManagerInterface {
return pt_;
}
+ /**
+ * @brief OnDeviceSwitching Processes existing policy permissions for devices
+ * switching transport
+ * @param device_id_from Device ID original
+ * @param device_id_to Device ID new
+ */
+ void OnDeviceSwitching(const std::string& device_id_from,
+ const std::string& device_id_to) OVERRIDE;
+
private:
std::string currentDateTime();
struct AppHMITypeToString {
@@ -722,6 +731,13 @@ class CacheManager : public CacheManagerInterface {
void PersistData();
+ /**
+ * @brief Transform to lower case all non default application names in
+ * applications policies section
+ * @param pt polict rable for update
+ */
+ void MakeLowerCaseAppNames(policy_table::Table& pt) const;
+
void ResetCalculatedPermissions();
void AddCalculatedPermissions(const std::string& device_id,
@@ -740,7 +756,7 @@ class CacheManager : public CacheManagerInterface {
typedef std::set<std::string> UnpairedDevices;
UnpairedDevices is_unpaired_;
- sync_primitives::Lock cache_lock_;
+ mutable sync_primitives::Lock cache_lock_;
sync_primitives::Lock unpaired_lock_;
typedef std::map<std::string, Permissions> AppCalculatedPermissions;
diff --git a/src/components/policy/policy_regular/include/policy/cache_manager_interface.h b/src/components/policy/policy_regular/include/policy/cache_manager_interface.h
index 9712b799dc..9f7c7318db 100644
--- a/src/components/policy/policy_regular/include/policy/cache_manager_interface.h
+++ b/src/components/policy/policy_regular/include/policy/cache_manager_interface.h
@@ -641,6 +641,15 @@ class CacheManagerInterface {
*
*/
virtual utils::SharedPtr<policy_table::Table> pt() const = 0;
+
+ /**
+ * @brief OnDeviceSwitching Processes existing policy permissions for devices
+ * switching transport
+ * @param device_id_from Device ID original
+ * @param device_id_to Device ID new
+ */
+ virtual void OnDeviceSwitching(const std::string& device_id_from,
+ const std::string& device_id_to) = 0;
};
typedef utils::SharedPtr<CacheManagerInterface> CacheManagerInterfaceSPtr;
diff --git a/src/components/policy/policy_regular/include/policy/policy_helper.h b/src/components/policy/policy_regular/include/policy/policy_helper.h
index 996c2917d0..8a60801dd4 100644
--- a/src/components/policy/policy_regular/include/policy/policy_helper.h
+++ b/src/components/policy/policy_regular/include/policy/policy_helper.h
@@ -114,7 +114,8 @@ struct CheckAppPolicy {
const std::vector<FunctionalGroupPermission>& revoked_groups) const;
bool IsKnownAppication(const std::string& application_id) const;
void NotifySystem(const AppPoliciesValueType& app_policy) const;
- void SendPermissionsToApp(const AppPoliciesValueType& app_policy) const;
+ void SendPermissionsToApp(const std::string& app_id,
+ const policy_table::Strings& groups) const;
bool IsAppRevoked(const AppPoliciesValueType& app_policy) const;
bool NicknamesMatch(const AppPoliciesValueType& app_policy) const;
/**
diff --git a/src/components/policy/policy_regular/include/policy/policy_manager_impl.h b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h
index 1b39392c0c..941db1a67f 100644
--- a/src/components/policy/policy_regular/include/policy/policy_manager_impl.h
+++ b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h
@@ -553,6 +553,9 @@ class PolicyManagerImpl : public PolicyManager {
*/
void OnAppRegisteredOnMobile(const std::string& application_id) OVERRIDE;
+ void OnDeviceSwitching(const std::string& device_id_from,
+ const std::string& device_id_to) OVERRIDE;
+
/**
* @brief RetrieveCertificate Allows to obtain certificate in order
* to start secure connection.
diff --git a/src/components/policy/policy_regular/include/policy/policy_table/enums.h b/src/components/policy/policy_regular/include/policy/policy_table/enums.h
index 66ab9a1b60..4eb35d2aa4 100644
--- a/src/components/policy/policy_regular/include/policy/policy_table/enums.h
+++ b/src/components/policy/policy_regular/include/policy/policy_table/enums.h
@@ -87,6 +87,7 @@ enum Parameter {
P_DEVICESTATUS,
P_EMERGENCYEVENT,
P_ECALLINFO,
+ P_EMPTY // Added to allow empty parameters handling
};
bool IsValidEnum(Parameter val);
diff --git a/src/components/policy/policy_regular/include/policy/policy_types.h b/src/components/policy/policy_regular/include/policy/policy_types.h
index 25aa126a03..af1d119e7a 100644
--- a/src/components/policy/policy_regular/include/policy/policy_types.h
+++ b/src/components/policy/policy_regular/include/policy/policy_types.h
@@ -41,6 +41,8 @@
#include <utility>
#include "utils/shared_ptr.h"
#include "utils/helpers.h"
+#include "transport_manager/common.h"
+
namespace policy {
// TODO(PV): specify errors
@@ -190,7 +192,7 @@ struct DeviceParams {
std::string device_name;
std::string device_mac_address;
std::string device_connection_type;
- uint32_t device_handle;
+ transport_manager::DeviceHandle device_handle;
};
/**
diff --git a/src/components/policy/policy_regular/src/cache_manager.cc b/src/components/policy/policy_regular/src/cache_manager.cc
index 377278949b..6a142374d5 100644
--- a/src/components/policy/policy_regular/src/cache_manager.cc
+++ b/src/components/policy/policy_regular/src/cache_manager.cc
@@ -83,11 +83,27 @@ struct LanguageFinder {
const std::string& language_;
};
+struct PolicyTableUpdater {
+ PolicyTableUpdater(const policy_table::ApplicationParams& default_params)
+ : default_params_(default_params) {}
+
+ void operator()(policy_table::ApplicationPolicies::value_type& pt_value) {
+ if (policy::kDefaultId == pt_value.second.get_string()) {
+ pt_value.second = default_params_;
+ pt_value.second.set_to_string(policy::kDefaultId);
+ }
+ }
+
+ private:
+ const policy_table::ApplicationParams& default_params_;
+};
+
CacheManager::CacheManager()
: CacheManagerInterface()
, pt_(new policy_table::Table)
, backup_(new SQLPTRepresentation())
- , update_required(false) {
+ , update_required(false)
+ , cache_lock_(true) {
LOG4CXX_AUTO_TRACE(logger_);
backuper_ = new BackgroundBackuper(this);
backup_thread_ = threads::CreateThread("Backup thread", backuper_);
@@ -103,6 +119,7 @@ CacheManager::~CacheManager() {
}
const policy_table::Strings& CacheManager::GetGroups(const PTString& app_id) {
+ sync_primitives::AutoLock auto_lock(cache_lock_);
return pt_->policy_table.app_policies_section.apps[app_id].groups;
}
@@ -114,6 +131,7 @@ bool CacheManager::CanAppKeepContext(const std::string& app_id) const {
uint32_t CacheManager::HeartBeatTimeout(const std::string& app_id) const {
CACHE_MANAGER_CHECK(0);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
uint32_t result = 0;
if (!AppExists(app_id)) {
return result;
@@ -130,6 +148,7 @@ uint32_t CacheManager::HeartBeatTimeout(const std::string& app_id) const {
const policy_table::AppHMITypes* CacheManager::GetHMITypes(
const std::string& app_id) {
+ sync_primitives::AutoLock auto_lock(cache_lock_);
const policy_table::ApplicationPolicies& apps =
pt_->policy_table.app_policies_section.apps;
policy_table::ApplicationPolicies::const_iterator i = apps.find(app_id);
@@ -180,6 +199,7 @@ void CacheManager::GetAllAppGroups(const std::string& app_id,
return;
}
+ sync_primitives::AutoLock auto_lock(cache_lock_);
policy_table::ApplicationPolicies::const_iterator app_params_iter =
pt_->policy_table.app_policies_section.apps.find(app_id);
@@ -244,6 +264,11 @@ bool CacheManager::ApplyUpdate(const policy_table::Table& update_pt) {
"");
} else {
pt_->policy_table.app_policies_section.apps[iter->first] = iter->second;
+ if (kDefaultId == iter->first) {
+ std::for_each(pt_->policy_table.app_policies_section.apps.begin(),
+ pt_->policy_table.app_policies_section.apps.end(),
+ PolicyTableUpdater(iter->second));
+ }
}
}
@@ -265,6 +290,7 @@ void CacheManager::GetHMIAppTypeAfterUpdate(
std::map<std::string, StringArray>& app_hmi_types) {
LOG4CXX_AUTO_TRACE(logger_);
CACHE_MANAGER_CHECK_VOID();
+ sync_primitives::AutoLock auto_lock(cache_lock_);
policy_table::ApplicationPolicies::const_iterator policy_iter_begin =
pt_->policy_table.app_policies_section.apps.begin();
policy_table::ApplicationPolicies::const_iterator policy_iter_end =
@@ -288,6 +314,7 @@ void CacheManager::GetHMIAppTypeAfterUpdate(
bool CacheManager::AppHasHMIType(const std::string& application_id,
policy_table::AppHMIType hmi_type) const {
+ sync_primitives::AutoLock auto_lock(cache_lock_);
const policy_table::ApplicationPolicies& policies =
pt_->policy_table.app_policies_section.apps;
@@ -399,6 +426,7 @@ bool CacheManager::ReactOnUserDevConsentForApp(const std::string& app_id,
void CacheManager::GetGroupNameByHashID(const int32_t group_id,
std::string& group_name) {
CACHE_MANAGER_CHECK_VOID();
+ sync_primitives::AutoLock auto_lock(cache_lock_);
policy_table::FunctionalGroupings::const_iterator fg_iter =
pt_->policy_table.functional_groupings.begin();
policy_table::FunctionalGroupings::const_iterator fg_iter_end =
@@ -432,6 +460,7 @@ void CacheManager::SaveUpdateRequired(bool status) {
bool CacheManager::IsApplicationRevoked(const std::string& app_id) const {
CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
bool is_revoked = false;
if (pt_->policy_table.app_policies_section.apps.end() !=
pt_->policy_table.app_policies_section.apps.find(app_id)) {
@@ -447,6 +476,7 @@ void CacheManager::CheckPermissions(const policy_table::Strings& groups,
CheckPermissionResult& result) {
LOG4CXX_AUTO_TRACE(logger_);
CACHE_MANAGER_CHECK_VOID();
+ sync_primitives::AutoLock auto_lock(cache_lock_);
policy_table::Strings::const_iterator app_groups_iter = groups.begin();
policy_table::Strings::const_iterator app_groups_iter_end = groups.end();
@@ -463,6 +493,13 @@ void CacheManager::CheckPermissions(const policy_table::Strings& groups,
if (rpcs.rpcs.end() != rpc_iter) {
policy_table::RpcParameters rpc_param = rpc_iter->second;
+ if (rpc_param.parameters.is_initialized() &&
+ rpc_param.parameters->empty()) {
+ // If "parameters" field exist in PT section of incoming RPC but empty
+ // all params considered as DISALLOWED
+ result.hmi_level_permitted = kRpcDisallowed;
+ return;
+ }
policy_table::HmiLevel hmi_level_e;
policy_table::EnumFromJsonString(hmi_level, &hmi_level_e);
@@ -491,11 +528,13 @@ void CacheManager::CheckPermissions(const policy_table::Strings& groups,
bool CacheManager::IsPTPreloaded() {
CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
return *pt_->policy_table.module_config.preloaded_pt;
}
int CacheManager::IgnitionCyclesBeforeExchange() {
CACHE_MANAGER_CHECK(0);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
const uint8_t limit = std::max(
static_cast<int>(
pt_->policy_table.module_config.exchange_after_x_ignition_cycles),
@@ -515,6 +554,7 @@ int CacheManager::IgnitionCyclesBeforeExchange() {
int CacheManager::KilometersBeforeExchange(int current) {
CACHE_MANAGER_CHECK(0);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
const int limit =
std::max(static_cast<int>(
pt_->policy_table.module_config.exchange_after_x_kilometers),
@@ -535,6 +575,7 @@ int CacheManager::KilometersBeforeExchange(int current) {
bool CacheManager::SetCountersPassedForSuccessfulUpdate(
policy::Counters counter, int value) {
CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
switch (counter) {
case KILOMETERS:
*pt_->policy_table.module_meta->pt_exchanged_at_odometer_x = value;
@@ -560,6 +601,7 @@ bool CacheManager::SetCountersPassedForSuccessfulUpdate(
int CacheManager::DaysBeforeExchange(int current) {
LOG4CXX_AUTO_TRACE(logger_);
CACHE_MANAGER_CHECK(0);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
const rpc::Optional<rpc::Integer<uint16_t, 0, 65535> >& days_after_epoch =
(pt_->policy_table.module_meta->pt_exchanged_x_days_after_epoch);
@@ -583,6 +625,7 @@ int CacheManager::DaysBeforeExchange(int current) {
void CacheManager::IncrementIgnitionCycles() {
CACHE_MANAGER_CHECK_VOID();
+ sync_primitives::AutoLock auto_lock(cache_lock_);
const int ign_val = static_cast<int>(
*pt_->policy_table.module_meta->ignition_cycles_since_last_exchange);
(*pt_->policy_table.module_meta->ignition_cycles_since_last_exchange) =
@@ -593,18 +636,21 @@ void CacheManager::IncrementIgnitionCycles() {
void CacheManager::ResetIgnitionCycles() {
CACHE_MANAGER_CHECK_VOID();
+ sync_primitives::AutoLock auto_lock(cache_lock_);
(*pt_->policy_table.module_meta->ignition_cycles_since_last_exchange) = 0;
Backup();
}
int CacheManager::TimeoutResponse() {
CACHE_MANAGER_CHECK(0);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
return pt_->policy_table.module_config.timeout_after_x_seconds *
date_time::DateTime::MILLISECONDS_IN_SECOND;
}
bool CacheManager::SecondsBetweenRetries(std::vector<int>& seconds) {
CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
rpc::policy_table_interface_base::SecondsBetweenRetries::iterator iter =
pt_->policy_table.module_config.seconds_between_retries.begin();
rpc::policy_table_interface_base::SecondsBetweenRetries::iterator iter_end =
@@ -621,6 +667,7 @@ bool CacheManager::SecondsBetweenRetries(std::vector<int>& seconds) {
const policy::VehicleInfo CacheManager::GetVehicleInfo() const {
CACHE_MANAGER_CHECK(VehicleInfo());
+ sync_primitives::AutoLock auto_lock(cache_lock_);
policy_table::ModuleConfig& module_config = pt_->policy_table.module_config;
VehicleInfo vehicle_info;
vehicle_info.vehicle_make = *module_config.vehicle_make;
@@ -642,6 +689,7 @@ std::vector<UserFriendlyMessage> CacheManager::GetUserFriendlyMsg(
std::vector<std::string>::const_iterator it = msg_codes.begin();
std::vector<std::string>::const_iterator it_end = msg_codes.end();
+ sync_primitives::AutoLock auto_lock(cache_lock_);
for (; it != it_end; ++it) {
policy_table::MessageLanguages msg_languages =
(*pt_->policy_table.consumer_friendly_messages->messages)[*it];
@@ -701,6 +749,7 @@ void CacheManager::GetUpdateUrls(const std::string& service_type,
LOG4CXX_DEBUG(logger_, "Search service value is: " << service_type);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
policy_table::ServiceEndpoints::const_iterator iter =
pt_->policy_table.module_config.endpoints.find(service_type);
@@ -733,6 +782,7 @@ CacheManager::GetNotificationsNumber(const std::string& priority) {
CACHE_MANAGER_CHECK(0);
typedef rpc::policy_table_interface_base::NumberOfNotificationsPerMinute NNPM;
+ sync_primitives::AutoLock auto_lock(cache_lock_);
const NNPM& nnpm =
pt_->policy_table.module_config.notifications_per_minute_by_priority;
@@ -746,6 +796,7 @@ CacheManager::GetNotificationsNumber(const std::string& priority) {
bool CacheManager::GetPriority(const std::string& policy_app_id,
std::string& priority) const {
CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
if (kDeviceId == policy_app_id) {
priority = EnumToJsonString(
pt_->policy_table.app_policies_section.device.priority);
@@ -884,9 +935,10 @@ void CacheManager::PersistData() {
LOG4CXX_AUTO_TRACE(logger_);
if (backup_.valid()) {
if (pt_.valid()) {
- cache_lock_.Acquire();
- policy_table::Table copy_pt(*pt_);
- cache_lock_.Release();
+ // Comma expression is used to hold the lock only during the constructor
+ // call
+ policy_table::Table copy_pt(
+ (sync_primitives::AutoLock(cache_lock_), *pt_));
backup_->Save(copy_pt);
backup_->SaveUpdateRequired(update_required);
@@ -978,12 +1030,12 @@ bool CacheManager::IsPermissionsCalculated(const std::string& device_id,
utils::SharedPtr<policy_table::Table> CacheManager::GenerateSnapshot() {
CACHE_MANAGER_CHECK(snapshot_);
- sync_primitives::AutoLock lock(cache_lock_);
snapshot_ = new policy_table::Table();
// Copy all members of policy table except messages in consumer friendly
// messages
+ sync_primitives::AutoLock auto_lock(cache_lock_);
snapshot_->policy_table.app_policies_section =
pt_->policy_table.app_policies_section;
snapshot_->policy_table.functional_groupings =
@@ -1010,6 +1062,7 @@ bool CacheManager::GetInitialAppData(const std::string& app_id,
StringArray& app_hmi_types) {
LOG4CXX_AUTO_TRACE(logger_);
CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
policy_table::ApplicationPolicies::const_iterator policy_iter =
pt_->policy_table.app_policies_section.apps.find(app_id);
@@ -1032,6 +1085,7 @@ bool CacheManager::GetFunctionalGroupings(
policy_table::FunctionalGroupings& groups) {
LOG4CXX_AUTO_TRACE(logger_);
CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
const policy_table::FunctionalGroupings& f_groupings =
pt_->policy_table.functional_groupings;
@@ -1052,6 +1106,7 @@ bool CacheManager::SetMetaInfo(const std::string& ccpu_version,
const std::string& wers_country_code,
const std::string& language) {
CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
// We have to set preloaded flag as false in policy table on any response
// of GetSystemInfo (SDLAQ-CRS-2365)
@@ -1076,6 +1131,7 @@ bool CacheManager::SetSystemLanguage(const std::string& language) {
bool CacheManager::GetFunctionalGroupNames(FunctionalGroupNames& names) {
LOG4CXX_AUTO_TRACE(logger_);
CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
rpc::policy_table_interface_base::FunctionalGroupings::iterator iter =
pt_->policy_table.functional_groupings.begin();
rpc::policy_table_interface_base::FunctionalGroupings::iterator iter_end =
@@ -1209,7 +1265,7 @@ long CacheManager::ConvertSecondsToMinute(int seconds) {
bool CacheManager::SetDefaultPolicy(const std::string& app_id) {
CACHE_MANAGER_CHECK(false);
- sync_primitives::AutoLock lock(cache_lock_);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
policy_table::ApplicationPolicies::const_iterator iter =
pt_->policy_table.app_policies_section.apps.find(kDefaultId);
if (pt_->policy_table.app_policies_section.apps.end() != iter) {
@@ -1224,6 +1280,7 @@ bool CacheManager::SetDefaultPolicy(const std::string& app_id) {
bool CacheManager::IsDefaultPolicy(const std::string& app_id) const {
CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
const bool result =
pt_->policy_table.app_policies_section.apps.end() !=
pt_->policy_table.app_policies_section.apps.find(app_id) &&
@@ -1235,6 +1292,7 @@ bool CacheManager::IsDefaultPolicy(const std::string& app_id) const {
bool CacheManager::SetIsDefault(const std::string& app_id) {
CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
policy_table::ApplicationPolicies::const_iterator iter =
pt_->policy_table.app_policies_section.apps.find(app_id);
if (pt_->policy_table.app_policies_section.apps.end() != iter) {
@@ -1246,7 +1304,7 @@ bool CacheManager::SetIsDefault(const std::string& app_id) {
bool CacheManager::SetPredataPolicy(const std::string& app_id) {
CACHE_MANAGER_CHECK(false);
- sync_primitives::AutoLock lock(cache_lock_);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
policy_table::ApplicationPolicies::const_iterator iter =
pt_->policy_table.app_policies_section.apps.find(kPreDataConsentId);
@@ -1270,6 +1328,7 @@ bool CacheManager::SetPredataPolicy(const std::string& app_id) {
bool CacheManager::IsPredataPolicy(const std::string& app_id) const {
// TODO(AOleynik): Maybe change for comparison with pre_DataConsent
// permissions or check string value from get_string()
+ sync_primitives::AutoLock auto_lock(cache_lock_);
if (!IsApplicationRepresented(app_id)) {
return false;
}
@@ -1296,6 +1355,7 @@ bool CacheManager::IsPredataPolicy(const std::string& app_id) const {
bool CacheManager::SetUnpairedDevice(const std::string& device_id,
bool unpaired) {
+ sync_primitives::AutoLock auto_lock(cache_lock_);
const bool result = pt_->policy_table.device_data->end() !=
pt_->policy_table.device_data->find(device_id);
if (!result) {
@@ -1328,6 +1388,7 @@ bool CacheManager::IsApplicationRepresented(const std::string& app_id) const {
if (kDeviceId == app_id) {
return true;
}
+ sync_primitives::AutoLock auto_lock(cache_lock_);
policy_table::ApplicationPolicies::const_iterator iter =
pt_->policy_table.app_policies_section.apps.find(app_id);
return pt_->policy_table.app_policies_section.apps.end() != iter;
@@ -1398,6 +1459,27 @@ bool CacheManager::LoadFromBackup() {
return true;
}
+void CacheManager::MakeLowerCaseAppNames(policy_table::Table& pt) const {
+ policy_table::ApplicationPolicies& apps =
+ pt.policy_table.app_policies_section.apps;
+ for (policy_table::ApplicationPolicies::iterator iter = apps.begin();
+ iter != apps.end();) {
+ std::string key = iter->first;
+ if (key == kDefaultId || key == kPreDataConsentId || key == kDeviceId) {
+ ++iter;
+ continue;
+ }
+
+ std::transform(key.begin(), key.end(), key.begin(), ::tolower);
+ if (key.compare(iter->first) != 0) {
+ std::swap(apps[key], iter->second);
+ iter = apps.erase(iter);
+ } else {
+ ++iter;
+ }
+ }
+}
+
bool CacheManager::LoadFromFile(const std::string& file_name,
policy_table::Table& table) {
LOG4CXX_AUTO_TRACE(logger_);
@@ -1426,6 +1508,8 @@ bool CacheManager::LoadFromFile(const std::string& file_name,
LOG4CXX_DEBUG(logger_, "PT out:");
LOG4CXX_DEBUG(logger_, s_writer.write(table.ToJsonValue()));
+ MakeLowerCaseAppNames(table);
+
if (!table.is_valid()) {
rpc::ValidationReport report("policy_table");
table.ReportErrors(&report);
@@ -1433,6 +1517,7 @@ bool CacheManager::LoadFromFile(const std::string& file_name,
"Parsed table is not valid " << rpc::PrettyFormat(report));
return false;
}
+
return true;
}
@@ -1444,6 +1529,7 @@ bool CacheManager::ResetPT(const std::string& file_name) {
bool CacheManager::AppExists(const std::string& app_id) const {
CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
policy_table::ApplicationPolicies::iterator policy_iter =
pt_->policy_table.app_policies_section.apps.find(app_id);
return pt_->policy_table.app_policies_section.apps.end() != policy_iter;
@@ -1469,6 +1555,7 @@ void CacheManager::GetAppRequestTypes(
std::vector<std::string>& request_types) const {
LOG4CXX_AUTO_TRACE(logger_);
CACHE_MANAGER_CHECK_VOID();
+ sync_primitives::AutoLock auto_lock(cache_lock_);
if (kDeviceId == policy_app_id) {
LOG4CXX_DEBUG(logger_,
"Request types not applicable for app_id " << kDeviceId);
@@ -1492,6 +1579,7 @@ void CacheManager::GetAppRequestTypes(
std::string CacheManager::GetCertificate() const {
CACHE_MANAGER_CHECK(std::string(""));
+ sync_primitives::AutoLock auto_lock(cache_lock_);
if (pt_->policy_table.module_config.certificate.is_initialized()) {
return *pt_->policy_table.module_config.certificate;
}
@@ -1588,6 +1676,12 @@ const PolicySettings& CacheManager::get_settings() const {
return *settings_;
}
+void CacheManager::OnDeviceSwitching(const std::string& device_id_from,
+ const std::string& device_id_to) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_INFO(logger_, "Implementation does not support user consents.");
+}
+
CacheManager::BackgroundBackuper::BackgroundBackuper(
CacheManager* cache_manager)
: cache_manager_(cache_manager)
@@ -1615,9 +1709,10 @@ void CacheManager::BackgroundBackuper::threadMain() {
LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoLock lock(need_backup_lock_);
while (!stop_flag_) {
- need_backup_lock_.Release();
- InternalBackup();
- need_backup_lock_.Acquire();
+ {
+ sync_primitives::AutoUnlock unlock(need_backup_lock_);
+ InternalBackup();
+ }
if (new_data_available_ || stop_flag_) {
continue;
}
diff --git a/src/components/policy/policy_regular/src/policy_helper.cc b/src/components/policy/policy_regular/src/policy_helper.cc
index b72a041a83..95f275769c 100644
--- a/src/components/policy/policy_regular/src/policy_helper.cc
+++ b/src/components/policy/policy_regular/src/policy_helper.cc
@@ -267,9 +267,7 @@ void policy::CheckAppPolicy::NotifySystem(
}
void CheckAppPolicy::SendPermissionsToApp(
- const AppPoliciesValueType& app_policy) const {
- const std::string app_id = app_policy.first;
-
+ const std::string& app_id, const policy_table::Strings& groups) const {
const std::string device_id = pm_->GetCurrentDeviceId(app_id);
if (device_id.empty()) {
LOG4CXX_WARN(logger_,
@@ -281,7 +279,7 @@ void CheckAppPolicy::SendPermissionsToApp(
Permissions notification_data;
pm_->PrepareNotificationData(update_->policy_table.functional_groupings,
- app_policy.second.groups,
+ groups,
group_permissons,
notification_data);
@@ -356,6 +354,20 @@ bool CheckAppPolicy::operator()(const AppPoliciesValueType& app_policy) {
"Permissions for application:" << app_id
<< " have been changed.");
+ if (IsPredefinedApp(app_policy)) {
+ for (const policy_table::ApplicationPolicies::value_type& app :
+ snapshot_->policy_table.app_policies_section.apps) {
+ if (app_policy.first == app.second.get_string()) {
+ if (RESULT_CONSENT_NOT_REQIURED != result) {
+ SetPendingPermissions(app, result);
+ NotifySystem(app);
+ }
+ SendPermissionsToApp(app.first, app_policy.second.groups);
+ }
+ }
+ return true;
+ }
+
if (!IsPredefinedApp(app_policy) && RESULT_CONSENT_NOT_REQIURED != result) {
SetPendingPermissions(app_policy, result);
NotifySystem(app_policy);
@@ -363,7 +375,7 @@ bool CheckAppPolicy::operator()(const AppPoliciesValueType& app_policy) {
// Don't sent notification for predefined apps (e.g. default, device etc.)
if (!IsPredefinedApp(app_policy)) {
- SendPermissionsToApp(app_policy);
+ SendPermissionsToApp(app_policy.first, app_policy.second.groups);
}
return true;
}
@@ -697,7 +709,7 @@ void FillFunctionalGroupPermissions(
FunctionalGroupNames& names,
GroupConsent state,
std::vector<FunctionalGroupPermission>& permissions) {
- LOG4CXX_INFO(logger_, "FillFunctionalGroupPermissions");
+ LOG4CXX_AUTO_TRACE(logger_);
FunctionalGroupIDs::const_iterator it = ids.begin();
FunctionalGroupIDs::const_iterator it_end = ids.end();
for (; it != it_end; ++it) {
@@ -717,7 +729,7 @@ bool IsPredefinedApp(const AppPoliciesValueType& app) {
FunctionalGroupIDs ExcludeSame(const FunctionalGroupIDs& from,
const FunctionalGroupIDs& what) {
- LOG4CXX_INFO(logger_, "Exclude same groups");
+ LOG4CXX_AUTO_TRACE(logger_);
FunctionalGroupIDs from_copy(from);
FunctionalGroupIDs what_copy(what);
@@ -739,7 +751,7 @@ FunctionalGroupIDs ExcludeSame(const FunctionalGroupIDs& from,
FunctionalGroupIDs Merge(const FunctionalGroupIDs& first,
const FunctionalGroupIDs& second) {
- LOG4CXX_INFO(logger_, "Merge groups");
+ LOG4CXX_AUTO_TRACE(logger_);
FunctionalGroupIDs first_copy(first);
FunctionalGroupIDs second_copy(second);
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 640b9c1457..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;
}
@@ -366,6 +372,12 @@ void PolicyManagerImpl::OnAppRegisteredOnMobile(
SendNotificationOnPermissionsUpdated(application_id);
}
+void PolicyManagerImpl::OnDeviceSwitching(const std::string& device_id_from,
+ const std::string& device_id_to) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ cache_->OnDeviceSwitching(device_id_from, device_id_to);
+}
+
const std::vector<std::string> PolicyManagerImpl::GetAppRequestTypes(
const std::string policy_app_id) const {
std::vector<std::string> request_types;
@@ -748,7 +760,7 @@ void PolicyManagerImpl::GetPermissionsForApp(
std::string& PolicyManagerImpl::GetCurrentDeviceId(
const std::string& policy_app_id) const {
- LOG4CXX_INFO(logger_, "GetDeviceInfo");
+ LOG4CXX_AUTO_TRACE(logger_);
last_device_id_ = listener()->OnCurrentDeviceIdUpdateRequired(policy_app_id);
return last_device_id_;
}
diff --git a/src/components/policy/policy_regular/src/policy_table/enums.cc b/src/components/policy/policy_regular/src/policy_table/enums.cc
index e0f77be989..34d12420d8 100644
--- a/src/components/policy/policy_regular/src/policy_table/enums.cc
+++ b/src/components/policy/policy_regular/src/policy_table/enums.cc
@@ -161,6 +161,8 @@ bool IsValidEnum(Parameter val) {
return true;
case P_ECALLINFO:
return true;
+ case P_EMPTY:
+ return true;
default:
return false;
}
@@ -217,10 +219,13 @@ const char* EnumToJsonString(Parameter val) {
return "emergencyEvent";
case P_ECALLINFO:
return "eCallInfo";
+ case P_EMPTY:
+ return "EMPTY";
default:
return "";
}
}
+
bool EnumFromJsonString(const std::string& literal, Parameter* result) {
if ("gps" == literal) {
*result = P_GPS;
@@ -297,6 +302,9 @@ bool EnumFromJsonString(const std::string& literal, Parameter* result) {
} else if ("eCallInfo" == literal) {
*result = P_ECALLINFO;
return true;
+ } else if ("EMPTY" == literal) {
+ *result = P_EMPTY;
+ return true;
} else {
return false;
}
diff --git a/src/components/policy/policy_regular/src/policy_table/types.cc b/src/components/policy/policy_regular/src/policy_table/types.cc
index 27a43c84ad..5f6f85f5dd 100644
--- a/src/components/policy/policy_regular/src/policy_table/types.cc
+++ b/src/components/policy/policy_regular/src/policy_table/types.cc
@@ -308,19 +308,24 @@ void ApplicationParams::SetPolicyTableType(PolicyTableType pt_type) {
// RpcParameters methods
RpcParameters::RpcParameters() : CompositeType(kUninitialized) {}
+
RpcParameters::RpcParameters(const HmiLevels& hmi_levels)
: CompositeType(kUninitialized), hmi_levels(hmi_levels) {}
+
RpcParameters::~RpcParameters() {}
+
RpcParameters::RpcParameters(const Json::Value* value__)
: CompositeType(InitHelper(value__, &Json::Value::isObject))
, hmi_levels(impl::ValueMember(value__, "hmi_levels"))
, parameters(impl::ValueMember(value__, "parameters")) {}
+
Json::Value RpcParameters::ToJsonValue() const {
Json::Value result__(Json::objectValue);
impl::WriteJsonField("hmi_levels", hmi_levels, &result__);
impl::WriteJsonField("parameters", parameters, &result__);
return result__;
}
+
bool RpcParameters::is_valid() const {
if (!hmi_levels.is_valid()) {
return false;
@@ -330,9 +335,11 @@ bool RpcParameters::is_valid() const {
}
return Validate();
}
+
bool RpcParameters::is_initialized() const {
return (initialization_state__ != kUninitialized) || (!struct_empty());
}
+
bool RpcParameters::struct_empty() const {
if (hmi_levels.is_initialized()) {
return false;
@@ -343,6 +350,7 @@ bool RpcParameters::struct_empty() const {
return true;
}
+
void RpcParameters::ReportErrors(rpc::ValidationReport* report__) const {
if (struct_empty()) {
rpc::CompositeType::ReportErrors(report__);
@@ -363,18 +371,23 @@ void RpcParameters::SetPolicyTableType(PolicyTableType pt_type) {
// Rpcs methods
Rpcs::Rpcs() : CompositeType(kUninitialized) {}
+
Rpcs::Rpcs(const Rpc& rpcs) : CompositeType(kUninitialized), rpcs(rpcs) {}
+
Rpcs::~Rpcs() {}
+
Rpcs::Rpcs(const Json::Value* value__)
: CompositeType(InitHelper(value__, &Json::Value::isObject))
, user_consent_prompt(impl::ValueMember(value__, "user_consent_prompt"))
, rpcs(impl::ValueMember(value__, "rpcs")) {}
+
Json::Value Rpcs::ToJsonValue() const {
Json::Value result__(Json::objectValue);
impl::WriteJsonField("user_consent_prompt", user_consent_prompt, &result__);
impl::WriteJsonField("rpcs", rpcs, &result__);
return result__;
}
+
bool Rpcs::is_valid() const {
if (!user_consent_prompt.is_valid()) {
return false;
@@ -384,9 +397,11 @@ bool Rpcs::is_valid() const {
}
return Validate();
}
+
bool Rpcs::is_initialized() const {
return (initialization_state__ != kUninitialized) || (!struct_empty());
}
+
bool Rpcs::struct_empty() const {
if (user_consent_prompt.is_initialized()) {
return false;
@@ -397,6 +412,7 @@ bool Rpcs::struct_empty() const {
return true;
}
+
void Rpcs::ReportErrors(rpc::ValidationReport* report__) const {
if (struct_empty()) {
rpc::CompositeType::ReportErrors(report__);
@@ -418,6 +434,7 @@ void Rpcs::SetPolicyTableType(PolicyTableType pt_type) {
// ModuleConfig methods
ModuleConfig::ModuleConfig() : CompositeType(kUninitialized) {}
+
ModuleConfig::ModuleConfig(
uint8_t exchange_after_x_ignition_cycles,
int64_t exchange_after_x_kilometers,
@@ -435,7 +452,9 @@ ModuleConfig::ModuleConfig(
, endpoints(endpoints)
, notifications_per_minute_by_priority(
notifications_per_minute_by_priority) {}
+
ModuleConfig::~ModuleConfig() {}
+
ModuleConfig::ModuleConfig(const Json::Value* value__)
: CompositeType(InitHelper(value__, &Json::Value::isObject))
, device_certificates(impl::ValueMember(value__, "device_certificates"))
@@ -501,6 +520,7 @@ Json::Value ModuleConfig::ToJsonValue() const {
impl::WriteJsonField("preloaded_date", preloaded_date, &result__);
return result__;
}
+
bool ModuleConfig::is_valid() const {
if (!preloaded_pt.is_valid()) {
return false;
@@ -543,9 +563,11 @@ bool ModuleConfig::is_valid() const {
}
return Validate();
}
+
bool ModuleConfig::is_initialized() const {
return (initialization_state__ != kUninitialized) || (!struct_empty());
}
+
bool ModuleConfig::struct_empty() const {
if (preloaded_pt.is_initialized()) {
return false;
@@ -587,6 +609,7 @@ bool ModuleConfig::struct_empty() const {
}
return true;
}
+
void ModuleConfig::ReportErrors(rpc::ValidationReport* report__) const {
if (struct_empty()) {
rpc::CompositeType::ReportErrors(report__);
@@ -670,7 +693,9 @@ void ModuleConfig::SetPolicyTableType(PolicyTableType pt_type) {
// MessageString methods
MessageString::MessageString() : CompositeType(kUninitialized) {}
+
MessageString::~MessageString() {}
+
MessageString::MessageString(const Json::Value* value__)
: CompositeType(InitHelper(value__, &Json::Value::isObject))
, line1(impl::ValueMember(value__, "line1"))
@@ -678,6 +703,7 @@ MessageString::MessageString(const Json::Value* value__)
, tts(impl::ValueMember(value__, "tts"))
, label(impl::ValueMember(value__, "label"))
, textBody(impl::ValueMember(value__, "textBody")) {}
+
Json::Value MessageString::ToJsonValue() const {
Json::Value result__(Json::objectValue);
impl::WriteJsonField("line1", line1, &result__);
@@ -687,6 +713,7 @@ Json::Value MessageString::ToJsonValue() const {
impl::WriteJsonField("textBody", textBody, &result__);
return result__;
}
+
bool MessageString::is_valid() const {
if (struct_empty()) {
return initialization_state__ == kInitialized && Validate();
@@ -708,9 +735,11 @@ bool MessageString::is_valid() const {
}
return Validate();
}
+
bool MessageString::is_initialized() const {
return (initialization_state__ != kUninitialized) || (!struct_empty());
}
+
bool MessageString::struct_empty() const {
if (line1.is_initialized()) {
return false;
@@ -731,6 +760,7 @@ bool MessageString::struct_empty() const {
}
return true;
}
+
void MessageString::ReportErrors(rpc::ValidationReport* report__) const {
if (struct_empty()) {
rpc::CompositeType::ReportErrors(report__);
@@ -765,17 +795,22 @@ void MessageString::SetPolicyTableType(PolicyTableType pt_type) {
const std::string MessageLanguages::default_language_("en-us");
MessageLanguages::MessageLanguages() : CompositeType(kUninitialized) {}
+
MessageLanguages::MessageLanguages(const Languages& languages)
: CompositeType(kUninitialized), languages(languages) {}
+
MessageLanguages::~MessageLanguages() {}
+
MessageLanguages::MessageLanguages(const Json::Value* value__)
: CompositeType(InitHelper(value__, &Json::Value::isObject))
, languages(impl::ValueMember(value__, "languages")) {}
+
Json::Value MessageLanguages::ToJsonValue() const {
Json::Value result__(Json::objectValue);
impl::WriteJsonField("languages", languages, &result__);
return result__;
}
+
bool MessageLanguages::is_valid() const {
if (!languages.is_valid()) {
return false;
@@ -786,9 +821,11 @@ bool MessageLanguages::is_valid() const {
}
return Validate();
}
+
bool MessageLanguages::is_initialized() const {
return (initialization_state__ != kUninitialized) || (!struct_empty());
}
+
bool MessageLanguages::struct_empty() const {
if (languages.is_initialized()) {
return false;
@@ -827,19 +864,24 @@ void MessageLanguages::SetPolicyTableType(PolicyTableType pt_type) {
// ConsumerFriendlyMessages methods
ConsumerFriendlyMessages::ConsumerFriendlyMessages()
: CompositeType(kUninitialized) {}
+
ConsumerFriendlyMessages::ConsumerFriendlyMessages(const std::string& version)
: CompositeType(kUninitialized), version(version) {}
+
ConsumerFriendlyMessages::~ConsumerFriendlyMessages() {}
+
ConsumerFriendlyMessages::ConsumerFriendlyMessages(const Json::Value* value__)
: CompositeType(InitHelper(value__, &Json::Value::isObject))
, version(impl::ValueMember(value__, "version"))
, messages(impl::ValueMember(value__, "messages")) {}
+
Json::Value ConsumerFriendlyMessages::ToJsonValue() const {
Json::Value result__(Json::objectValue);
impl::WriteJsonField("version", version, &result__);
impl::WriteJsonField("messages", messages, &result__);
return result__;
}
+
bool ConsumerFriendlyMessages::is_valid() const {
if (!version.is_valid()) {
return false;
@@ -849,9 +891,11 @@ bool ConsumerFriendlyMessages::is_valid() const {
}
return Validate();
}
+
bool ConsumerFriendlyMessages::is_initialized() const {
return (initialization_state__ != kUninitialized) || (!struct_empty());
}
+
bool ConsumerFriendlyMessages::struct_empty() const {
if (version.is_initialized()) {
return false;
@@ -862,6 +906,7 @@ bool ConsumerFriendlyMessages::struct_empty() const {
return true;
}
+
void ConsumerFriendlyMessages::ReportErrors(
rpc::ValidationReport* report__) const {
if (struct_empty()) {
@@ -892,7 +937,9 @@ void ConsumerFriendlyMessages::SetPolicyTableType(PolicyTableType pt_type) {
// ModuleMeta methods
ModuleMeta::ModuleMeta() : CompositeType(kUninitialized) {}
+
ModuleMeta::~ModuleMeta() {}
+
ModuleMeta::ModuleMeta(const Json::Value* value__)
: CompositeType(InitHelper(value__, &Json::Value::isObject))
, pt_exchanged_at_odometer_x(
@@ -901,6 +948,7 @@ ModuleMeta::ModuleMeta(const Json::Value* value__)
impl::ValueMember(value__, "pt_exchanged_x_days_after_epoch"))
, ignition_cycles_since_last_exchange(
impl::ValueMember(value__, "ignition_cycles_since_last_exchange")) {}
+
Json::Value ModuleMeta::ToJsonValue() const {
Json::Value result__(Json::objectValue);
impl::WriteJsonField(
@@ -913,6 +961,7 @@ Json::Value ModuleMeta::ToJsonValue() const {
&result__);
return result__;
}
+
bool ModuleMeta::is_valid() const {
if (struct_empty()) {
return initialization_state__ == kInitialized && Validate();
@@ -928,9 +977,11 @@ bool ModuleMeta::is_valid() const {
}
return Validate();
}
+
bool ModuleMeta::is_initialized() const {
return (initialization_state__ != kUninitialized) || (!struct_empty());
}
+
bool ModuleMeta::struct_empty() const {
if (pt_exchanged_at_odometer_x.is_initialized()) {
return false;
@@ -944,6 +995,7 @@ bool ModuleMeta::struct_empty() const {
}
return true;
}
+
void ModuleMeta::ReportErrors(rpc::ValidationReport* report__) const {
if (struct_empty()) {
rpc::CompositeType::ReportErrors(report__);
@@ -1006,7 +1058,9 @@ AppLevel::AppLevel(uint16_t minutes_in_hmi_full,
, count_of_tls_errors(count_of_tls_errors)
, count_of_run_attempts_while_revoked(count_of_run_attempts_while_revoked) {
}
+
AppLevel::~AppLevel() {}
+
AppLevel::AppLevel(const Json::Value* value__)
: CompositeType(InitHelper(value__, &Json::Value::isObject))
, minutes_in_hmi_full(impl::ValueMember(value__, "minutes_in_hmi_full"))
@@ -1042,6 +1096,7 @@ Json::Value AppLevel::ToJsonValue() const {
impl::WriteJsonField("count_of_TLS_errors", count_of_tls_errors, &result__);
return result__;
}
+
bool AppLevel::is_valid() const {
if (!minutes_in_hmi_full.is_valid()) {
return false;
@@ -1090,9 +1145,11 @@ bool AppLevel::is_valid() const {
}
return Validate();
}
+
bool AppLevel::is_initialized() const {
return (initialization_state__ != kUninitialized) || (!struct_empty());
}
+
bool AppLevel::struct_empty() const {
if (minutes_in_hmi_full.is_initialized()) {
return false;
@@ -1147,6 +1204,7 @@ bool AppLevel::struct_empty() const {
}
return true;
}
+
void AppLevel::ReportErrors(rpc::ValidationReport* report__) const {
if (struct_empty()) {
rpc::CompositeType::ReportErrors(report__);
@@ -1171,6 +1229,7 @@ Json::Value UsageAndErrorCounts::ToJsonValue() const {
impl::WriteJsonField("app_level", app_level, &result__);
return result__;
}
+
bool UsageAndErrorCounts::is_valid() const {
if (struct_empty()) {
return initialization_state__ == kInitialized && Validate();
@@ -1180,15 +1239,18 @@ bool UsageAndErrorCounts::is_valid() const {
}
return Validate();
}
+
bool UsageAndErrorCounts::is_initialized() const {
return (initialization_state__ != kUninitialized) || (!struct_empty());
}
+
bool UsageAndErrorCounts::struct_empty() const {
if (app_level.is_initialized()) {
return false;
}
return true;
}
+
void UsageAndErrorCounts::ReportErrors(rpc::ValidationReport* report__) const {
if (struct_empty()) {
rpc::CompositeType::ReportErrors(report__);
@@ -1211,25 +1273,32 @@ void UsageAndErrorCounts::SetPolicyTableType(PolicyTableType pt_type) {
// DeviceParams methods
DeviceParams::DeviceParams() : CompositeType(kUninitialized) {}
+
DeviceParams::~DeviceParams() {}
+
DeviceParams::DeviceParams(const Json::Value* value__)
: CompositeType(InitHelper(value__, &Json::Value::isObject)) {}
+
Json::Value DeviceParams::ToJsonValue() const {
Json::Value result__(Json::objectValue);
return result__;
}
+
bool DeviceParams::is_valid() const {
if (struct_empty()) {
return initialization_state__ == kInitialized && Validate();
}
return Validate();
}
+
bool DeviceParams::is_initialized() const {
return (initialization_state__ != kUninitialized) || (!struct_empty());
}
+
bool DeviceParams::struct_empty() const {
return true;
}
+
void DeviceParams::ReportErrors(rpc::ValidationReport* report__) const {
if (struct_empty()) {
rpc::CompositeType::ReportErrors(report__);
@@ -1238,6 +1307,7 @@ void DeviceParams::ReportErrors(rpc::ValidationReport* report__) const {
// PolicyTable methods
PolicyTable::PolicyTable() : CompositeType(kUninitialized) {}
+
PolicyTable::PolicyTable(
const ApplicationPoliciesSection& app_policies_section,
const FunctionalGroupings& functional_groupings,
@@ -1248,7 +1318,9 @@ PolicyTable::PolicyTable(
, functional_groupings(functional_groupings)
, consumer_friendly_messages(consumer_friendly_messages)
, module_config(module_config) {}
+
PolicyTable::~PolicyTable() {}
+
PolicyTable::PolicyTable(const Json::Value* value__)
: CompositeType(InitHelper(value__, &Json::Value::isObject))
, app_policies_section(impl::ValueMember(value__, "app_policies"))
@@ -1260,6 +1332,7 @@ PolicyTable::PolicyTable(const Json::Value* value__)
, usage_and_error_counts(
impl::ValueMember(value__, "usage_and_error_counts"))
, device_data(impl::ValueMember(value__, "device_data")) {}
+
Json::Value PolicyTable::ToJsonValue() const {
Json::Value result__(Json::objectValue);
impl::WriteJsonField("app_policies", app_policies_section, &result__);
@@ -1273,6 +1346,7 @@ Json::Value PolicyTable::ToJsonValue() const {
impl::WriteJsonField("device_data", device_data, &result__);
return result__;
}
+
bool PolicyTable::is_valid() const {
if (!app_policies_section.is_valid()) {
return false;
@@ -1297,9 +1371,11 @@ bool PolicyTable::is_valid() const {
}
return Validate();
}
+
bool PolicyTable::is_initialized() const {
return (initialization_state__ != kUninitialized) || (!struct_empty());
}
+
bool PolicyTable::struct_empty() const {
if (app_policies_section.is_initialized()) {
return false;
@@ -1327,6 +1403,7 @@ bool PolicyTable::struct_empty() const {
}
return true;
}
+
void PolicyTable::ReportErrors(rpc::ValidationReport* report__) const {
if (struct_empty()) {
rpc::CompositeType::ReportErrors(report__);
@@ -1381,32 +1458,40 @@ void PolicyTable::SetPolicyTableType(PolicyTableType pt_type) {
// Table methods
Table::Table() : CompositeType(kUninitialized) {}
+
Table::Table(const PolicyTable& policy_table)
: CompositeType(kUninitialized), policy_table(policy_table) {}
+
Table::~Table() {}
+
Table::Table(const Json::Value* value__)
: CompositeType(InitHelper(value__, &Json::Value::isObject))
, policy_table(impl::ValueMember(value__, "policy_table")) {}
+
Json::Value Table::ToJsonValue() const {
Json::Value result__(Json::objectValue);
impl::WriteJsonField("policy_table", policy_table, &result__);
return result__;
}
+
bool Table::is_valid() const {
if (!policy_table.is_valid()) {
return false;
}
return Validate();
}
+
bool Table::is_initialized() const {
return (initialization_state__ != kUninitialized) || (!struct_empty());
}
+
bool Table::struct_empty() const {
if (policy_table.is_initialized()) {
return false;
}
return true;
}
+
void Table::ReportErrors(rpc::ValidationReport* report__) const {
if (struct_empty()) {
rpc::CompositeType::ReportErrors(report__);
diff --git a/src/components/policy/policy_regular/src/sql_pt_queries.cc b/src/components/policy/policy_regular/src/sql_pt_queries.cc
index 7938eb4085..ef4ef49273 100644
--- a/src/components/policy/policy_regular/src/sql_pt_queries.cc
+++ b/src/components/policy/policy_regular/src/sql_pt_queries.cc
@@ -123,7 +123,7 @@ const std::string kCreateSchema =
"CREATE INDEX `rpc.select_rpc_name_hmi_level` "
" ON `rpc`(`name`,`hmi_level_value`);"
"CREATE TABLE IF NOT EXISTS `application`( "
- " `id` VARCHAR(45) PRIMARY KEY NOT NULL, "
+ " `id` VARCHAR(45) PRIMARY KEY NOT NULL COLLATE NOCASE, "
" `keep_context` BOOLEAN, "
" `steal_focus` BOOLEAN, "
" `default_hmi` VARCHAR(45), "
@@ -147,7 +147,7 @@ const std::string kCreateSchema =
"CREATE INDEX IF NOT EXISTS `application.fk_application_priorities1_idx` "
" ON `application`(`priority_value`); "
"CREATE TABLE IF NOT EXISTS `app_group`( "
- " `application_id` VARCHAR(45) NOT NULL, "
+ " `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE, "
" `functional_group_id` INTEGER NOT NULL, "
" PRIMARY KEY(`application_id`,`functional_group_id`), "
" CONSTRAINT `fk_application_has_functional_group_application1` "
@@ -162,9 +162,9 @@ const std::string kCreateSchema =
" ON `app_group`(`functional_group_id`); "
"CREATE INDEX IF NOT EXISTS "
"`app_group.fk_application_has_functional_group_application1_idx` "
- " ON `app_group`(`application_id`); "
+ " ON `app_group`(`application_id` COLLATE NOCASE); "
"CREATE TABLE IF NOT EXISTS `preconsented_group`( "
- " `application_id` VARCHAR(45) NOT NULL, "
+ " `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE, "
" `functional_group_id` INTEGER NOT NULL, "
" PRIMARY KEY(`application_id`,`functional_group_id`), "
" CONSTRAINT `fk_application_has_functional_group_application2` "
@@ -180,7 +180,7 @@ const std::string kCreateSchema =
" ON `preconsented_group`(`functional_group_id`); "
"CREATE INDEX IF NOT EXISTS "
"`preconsented_group.fk_application_has_functional_group_application2_idx` "
- " ON `preconsented_group`(`application_id`); "
+ " ON `preconsented_group`(`application_id` COLLATE NOCASE); "
"CREATE TABLE IF NOT EXISTS `seconds_between_retry`( "
" `index` INTEGER PRIMARY KEY NOT NULL, "
" `value` INTEGER NOT NULL "
@@ -207,7 +207,7 @@ const std::string kCreateSchema =
"`device_consent_group.fk_device_has_functional_group_device1_idx` "
" ON `device_consent_group`(`device_id`); "
"CREATE TABLE IF NOT EXISTS `app_level`( "
- " `application_id` VARCHAR(45) PRIMARY KEY NOT NULL, "
+ " `application_id` VARCHAR(45) PRIMARY KEY NOT NULL COLLATE NOCASE, "
" `minutes_in_hmi_full` INTEGER DEFAULT 0, "
" `minutes_in_hmi_limited` INTEGER DEFAULT 0, "
" `minutes_in_hmi_background` INTEGER DEFAULT 0, "
@@ -234,24 +234,24 @@ const std::string kCreateSchema =
" REFERENCES `language`(`code`) "
"); "
"CREATE INDEX IF NOT EXISTS `app_level.fk_app_levels_application1_idx` "
- " ON `app_level`(`application_id`); "
+ " ON `app_level`(`application_id` COLLATE NOCASE); "
"CREATE INDEX IF NOT EXISTS `app_level.fk_app_level_language1_idx` "
" ON `app_level`(`app_registration_language_gui`); "
"CREATE INDEX IF NOT EXISTS `app_level.fk_app_level_language2_idx` "
" ON `app_level`(`app_registration_language_vui`); "
"CREATE TABLE IF NOT EXISTS `nickname`( "
- " `name` VARCHAR(100) NOT NULL, "
- " `application_id` VARCHAR(45) NOT NULL, "
+ " `name` VARCHAR(100) NOT NULL COLLATE NOCASE, "
+ " `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE, "
" PRIMARY KEY(`name`,`application_id`), "
" CONSTRAINT `fk_nickname_application1` "
" FOREIGN KEY(`application_id`) "
" REFERENCES `application`(`id`) "
"); "
"CREATE INDEX IF NOT EXISTS `nickname.fk_nickname_application1_idx` "
- " ON `nickname`(`application_id`); "
+ " ON `nickname`(`application_id` COLLATE NOCASE); "
"CREATE TABLE IF NOT EXISTS `app_type`( "
" `name` VARCHAR(50) NOT NULL, "
- " `application_id` VARCHAR(45) NOT NULL, "
+ " `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE, "
" PRIMARY KEY(`name`,`application_id`), "
" CONSTRAINT `fk_app_type_application1` "
" FOREIGN KEY(`application_id`) "
@@ -259,17 +259,17 @@ const std::string kCreateSchema =
"); "
"CREATE TABLE IF NOT EXISTS `request_type`( "
" `request_type` VARCHAR(50) NOT NULL, "
- " `application_id` VARCHAR(45) NOT NULL, "
+ " `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE, "
" PRIMARY KEY(`request_type`,`application_id`), "
" CONSTRAINT `fk_app_type_application1` "
" FOREIGN KEY(`application_id`) "
" REFERENCES `application`(`id`) "
"); "
"CREATE INDEX IF NOT EXISTS `app_type.fk_app_type_application1_idx` "
- " ON `app_type`(`application_id`); "
+ " ON `app_type`(`application_id` COLLATE NOCASE); "
"CREATE TABLE IF NOT EXISTS `consent_group`( "
" `device_id` VARCHAR(100) NOT NULL, "
- " `application_id` VARCHAR(45) NOT NULL, "
+ " `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE, "
" `functional_group_id` INTEGER NOT NULL, "
" `is_consented` BOOL NOT NULL, "
" `input` VARCHAR(45), "
@@ -294,13 +294,13 @@ const std::string kCreateSchema =
"CREATE TABLE IF NOT EXISTS `endpoint`( "
" `service` VARCHAR(100) NOT NULL, "
" `url` VARCHAR(100) NOT NULL, "
- " `application_id` VARCHAR(45) NOT NULL, "
+ " `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE, "
" CONSTRAINT `fk_endpoint_application1` "
" FOREIGN KEY(`application_id`) "
" REFERENCES `application`(`id`) "
"); "
"CREATE INDEX IF NOT EXISTS `endpoint.fk_endpoint_application1_idx` "
- " ON `endpoint`(`application_id`); "
+ " ON `endpoint`(`application_id` COLLATE NOCASE); "
"CREATE TABLE IF NOT EXISTS `message`( "
" `id` INTEGER PRIMARY KEY NOT NULL, "
" `tts` TEXT, "
diff --git a/src/components/policy/policy_regular/src/sql_pt_representation.cc b/src/components/policy/policy_regular/src/sql_pt_representation.cc
index 04fc0d7658..9840a08b26 100644
--- a/src/components/policy/policy_regular/src/sql_pt_representation.cc
+++ b/src/components/policy/policy_regular/src/sql_pt_representation.cc
@@ -596,8 +596,8 @@ void SQLPTRepresentation::GatherDeviceData(
bool SQLPTRepresentation::GatherFunctionalGroupings(
policy_table::FunctionalGroupings* groups) const {
LOG4CXX_INFO(logger_, "Gather Functional Groupings info");
- utils::dbms::SQLQuery func_group(db());
- if (!func_group.Prepare(sql_pt::kSelectFunctionalGroups)) {
+ utils::dbms::SQLQuery functional_group(db());
+ if (!functional_group.Prepare(sql_pt::kSelectFunctionalGroups)) {
LOG4CXX_WARN(logger_, "Incorrect select from functional_groupings");
return false;
}
@@ -606,32 +606,50 @@ bool SQLPTRepresentation::GatherFunctionalGroupings(
LOG4CXX_WARN(logger_, "Incorrect select all from rpc");
return false;
}
- while (func_group.Next()) {
- policy_table::Rpcs rpcs_tbl;
- if (!func_group.IsNull(2)) {
- *rpcs_tbl.user_consent_prompt = func_group.GetString(2);
+
+ while (functional_group.Next()) {
+ policy_table::Rpcs rpcs_structure;
+
+ if (!functional_group.IsNull(2)) {
+ *rpcs_structure.user_consent_prompt = functional_group.GetString(2);
}
- int func_id = func_group.GetInteger(0);
- rpcs.Bind(0, func_id);
+
+ const int group_id = functional_group.GetInteger(0);
+
+ // Collecting RPCs with their HMI levels and parameters (if any)
+ rpcs.Bind(0, group_id);
while (rpcs.Next()) {
if (!rpcs.IsNull(1)) {
policy_table::HmiLevel level;
if (policy_table::EnumFromJsonString(rpcs.GetString(1), &level)) {
- InsertUnique(level, &rpcs_tbl.rpcs[rpcs.GetString(0)].hmi_levels);
+ InsertUnique(level,
+ &rpcs_structure.rpcs[rpcs.GetString(0)].hmi_levels);
}
}
if (!rpcs.IsNull(2)) {
policy_table::Parameter param;
- if (policy_table::EnumFromJsonString(rpcs.GetString(2), &param)) {
- InsertUnique(param, &(*rpcs_tbl.rpcs[rpcs.GetString(0)].parameters));
+ if (EnumFromJsonString(rpcs.GetString(2), &param)) {
+ // EMPTY is a special mark to specify that 'parameters' section is
+ // present, but has no parameters. It is not valid parameter value.
+ if (policy_table::P_EMPTY == param) {
+ (*rpcs_structure.rpcs[rpcs.GetString(0)].parameters)
+ .mark_initialized();
+ continue;
+ }
+ InsertUnique(param,
+ &(*rpcs_structure.rpcs[rpcs.GetString(0)].parameters));
}
}
}
- if (!rpcs_tbl.rpcs.is_initialized()) {
- rpcs_tbl.rpcs.set_to_null();
- }
+
rpcs.Reset();
- (*groups)[func_group.GetString(1)] = rpcs_tbl;
+
+ if (!rpcs_structure.rpcs.is_initialized()) {
+ rpcs_structure.rpcs.set_to_null();
+ }
+ policy_table::Rpcs& group_rpcs_structure =
+ (*groups)[functional_group.GetString(1)];
+ group_rpcs_structure = rpcs_structure;
}
return true;
}
@@ -848,6 +866,18 @@ bool SQLPTRepresentation::SaveRpcs(int64_t group_id,
return false;
}
}
+ } else if (parameters.is_initialized()) {
+ query_parameter.Bind(0, it->first);
+ query_parameter.Bind(
+ 1, std::string(policy_table::EnumToJsonString(*hmi_it)));
+ query_parameter.Bind(
+ 2,
+ std::string(policy_table::EnumToJsonString(policy_table::P_EMPTY)));
+ query_parameter.Bind(3, group_id);
+ if (!query_parameter.Exec() || !query_parameter.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into rpc with parameter");
+ return false;
+ }
} else {
query.Bind(0, it->first);
query.Bind(1, std::string(policy_table::EnumToJsonString(*hmi_it)));
@@ -1834,12 +1864,7 @@ bool SQLPTRepresentation::SetDefaultPolicy(const std::string& app_id) {
return false;
}
- bool ret = (GatherAppGroup(kDefaultId, &default_groups) &&
- SaveAppGroup(app_id, default_groups));
- if (ret) {
- return SetIsDefault(app_id, true);
- }
- return false;
+ return SetIsDefault(app_id, true);
}
bool SQLPTRepresentation::SetIsDefault(const std::string& app_id,
diff --git a/src/components/policy/policy_regular/test/PTU.json b/src/components/policy/policy_regular/test/PTU.json
index 6d663e9a0c..d9f70426d1 100644
--- a/src/components/policy/policy_regular/test/PTU.json
+++ b/src/components/policy/policy_regular/test/PTU.json
@@ -14,7 +14,7 @@
625],
"endpoints": {
"0x07": {
- "default": ["http://policies.telematics.ford.com/api/policies"]
+ "default": ["http://x.x.x.x:3000/api/1/policies"]
}
},
"notifications_per_minute_by_priority": {
diff --git a/src/components/policy/policy_regular/test/PTU2.json b/src/components/policy/policy_regular/test/PTU2.json
index 4062e94516..b4c3c0624c 100644
--- a/src/components/policy/policy_regular/test/PTU2.json
+++ b/src/components/policy/policy_regular/test/PTU2.json
@@ -14,7 +14,7 @@
625],
"endpoints": {
"0x07": {
- "default": ["http://policies.telematics.ford.com/api/policies"]
+ "default": ["http://x.x.x.x:3000/api/1/policies"]
}
},
"notifications_per_minute_by_priority": {
diff --git a/src/components/policy/policy_regular/test/PTU3.json b/src/components/policy/policy_regular/test/PTU3.json
index 78596189da..6309bd9cfd 100644
--- a/src/components/policy/policy_regular/test/PTU3.json
+++ b/src/components/policy/policy_regular/test/PTU3.json
@@ -83,7 +83,7 @@
625],
"endpoints": {
"0x07": {
- "default": ["http://policies.telematics.ford.com/api/policies"]
+ "default": ["http://x.x.x.x:3000/api/1/policies"]
}
},
"notifications_per_minute_by_priority": {
diff --git a/src/components/policy/policy_regular/test/PTU4.json b/src/components/policy/policy_regular/test/PTU4.json
index ab4c2f8927..651a4cb2ef 100644
--- a/src/components/policy/policy_regular/test/PTU4.json
+++ b/src/components/policy/policy_regular/test/PTU4.json
@@ -14,7 +14,7 @@
625],
"endpoints": {
"0x07": {
- "default": ["http://policies.telematics.ford.com/api/policies"]
+ "default": ["http://x.x.x.x:3000/api/1/policies"]
}
},
"notifications_per_minute_by_priority": {
diff --git a/src/components/policy/policy_regular/test/policy_manager_impl_test.cc b/src/components/policy/policy_regular/test/policy_manager_impl_test.cc
index f76e856cd0..5fd0a48f7c 100644
--- a/src/components/policy/policy_regular/test/policy_manager_impl_test.cc
+++ b/src/components/policy/policy_regular/test/policy_manager_impl_test.cc
@@ -181,7 +181,7 @@ class PolicyManagerImplTest2 : public ::testing::Test {
public:
PolicyManagerImplTest2()
: app_id1("123456789")
- , app_id2("1766825573")
+ , app_id2("1010101010")
, dev_id1("XXX123456789ZZZ")
, dev_id2("08-00-27-CE-76-FE")
, PTU_request_types(Json::arrayValue) {}
diff --git a/src/components/policy/policy_regular/test/ptu2_requestType.json b/src/components/policy/policy_regular/test/ptu2_requestType.json
index 50364397fd..e25095bb9f 100644
--- a/src/components/policy/policy_regular/test/ptu2_requestType.json
+++ b/src/components/policy/policy_regular/test/ptu2_requestType.json
@@ -17,12 +17,12 @@
"endpoints": {
"0x07": {
"default": [
- "http://policies.telematics.ford.com/api/policies"
+ "http://x.x.x.x:3000/api/1/policies"
]
},
"0x04": {
"default": [
- "http://ivsu.software.ford.com/api/getsoftwareupdates"
+ "http://x.x.x.x:3000/api/1/softwareUpdate"
]
}
},
@@ -2595,7 +2595,7 @@
"PROPRIETARY"
]
},
- "584421907": {
+ "123454321": {
"keep_context": false,
"steal_focus": false,
"priority": "NONE",
diff --git a/src/components/policy/policy_regular/test/ptu_requestType.json b/src/components/policy/policy_regular/test/ptu_requestType.json
index 44bd8356fe..c5aa6f0a6c 100644
--- a/src/components/policy/policy_regular/test/ptu_requestType.json
+++ b/src/components/policy/policy_regular/test/ptu_requestType.json
@@ -17,12 +17,12 @@
"endpoints": {
"0x07": {
"default": [
- "http://policies.telematics.ford.com/api/policies"
+ "http://x.x.x.x:3000/api/1/policies"
]
},
"0x04": {
"default": [
- "http://ivsu.software.ford.com/api/getsoftwareupdates"
+ "http://x.x.x.x:3000/api/1/softwareUpdate"
]
}
},
@@ -2590,7 +2590,7 @@
"PROPRIETARY"
]
},
- "584421907": {
+ "123454321": {
"keep_context": false,
"steal_focus": false,
"priority": "NONE",
diff --git a/src/components/policy/policy_regular/test/sdl_preloaded_pt.json b/src/components/policy/policy_regular/test/sdl_preloaded_pt.json
index d6f34c12fc..10894516cf 100644
--- a/src/components/policy/policy_regular/test/sdl_preloaded_pt.json
+++ b/src/components/policy/policy_regular/test/sdl_preloaded_pt.json
@@ -14,7 +14,7 @@
625],
"endpoints": {
"0x07": {
- "default": ["http://policies.telematics.ford.com/api/policies"]
+ "default": ["http://x.x.x.x:3000/api/1/policies"]
}
},
"notifications_per_minute_by_priority": {
diff --git a/src/components/policy/policy_regular/test/sdl_pt_first_update.json b/src/components/policy/policy_regular/test/sdl_pt_first_update.json
index e6817da0d3..ac2b18ab6f 100644
--- a/src/components/policy/policy_regular/test/sdl_pt_first_update.json
+++ b/src/components/policy/policy_regular/test/sdl_pt_first_update.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -1720,7 +1720,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_regular/test/sdl_pt_second_update.json b/src/components/policy/policy_regular/test/sdl_pt_second_update.json
index d5f5f480f3..230ad1fa4f 100644
--- a/src/components/policy/policy_regular/test/sdl_pt_second_update.json
+++ b/src/components/policy/policy_regular/test/sdl_pt_second_update.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -1720,7 +1720,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_regular/test/sdl_pt_update.json b/src/components/policy/policy_regular/test/sdl_pt_update.json
index a332f92382..f890e8e5ae 100644
--- a/src/components/policy/policy_regular/test/sdl_pt_update.json
+++ b/src/components/policy/policy_regular/test/sdl_pt_update.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -1698,7 +1698,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_regular/test/valid_sdl_pt_update.json b/src/components/policy/policy_regular/test/valid_sdl_pt_update.json
index 56c728f104..c384ea73e2 100644
--- a/src/components/policy/policy_regular/test/valid_sdl_pt_update.json
+++ b/src/components/policy/policy_regular/test/valid_sdl_pt_update.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -1696,7 +1696,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,