summaryrefslogtreecommitdiff
path: root/src/components/policy/policy_regular/include/policy
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/policy/policy_regular/include/policy')
-rw-r--r--src/components/policy/policy_regular/include/policy/cache_manager.h22
-rw-r--r--src/components/policy/policy_regular/include/policy/cache_manager_interface.h7
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_manager_impl.h3
3 files changed, 32 insertions, 0 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 9b0413d7ce..6bd2c4840b 100644
--- a/src/components/policy/policy_regular/include/policy/cache_manager.h
+++ b/src/components/policy/policy_regular/include/policy/cache_manager.h
@@ -154,6 +154,9 @@ class CacheManager : public CacheManagerInterface {
virtual const std::vector<policy_table::VehicleDataItem> GetVehicleDataItems()
const;
+ std::vector<policy_table::VehicleDataItem> GetRemovedVehicleDataItems()
+ const OVERRIDE;
+
const boost::optional<bool> LockScreenDismissalEnabledState() const OVERRIDE;
const boost::optional<std::string> LockScreenDismissalWarningMessage(
@@ -919,6 +922,24 @@ class CacheManager : public CacheManagerInterface {
*/
void CheckSnapshotInitialization();
+ /**
+ * @brief Calculates difference between two provided custom vehicle data items
+ * @param items_before list of vehicle data items before PTU was applied
+ * @param items_after list of vehicle data items after PTU was applied
+ * @return list with calculated difference or empty list if two input lists
+ * are equal
+ */
+ policy_table::VehicleDataItems CalculateCustomVdItemsDiff(
+ const policy_table::VehicleDataItems& items_before,
+ const policy_table::VehicleDataItems& items_after) const;
+
+ /**
+ * @brief Sets the custom vehicle data items
+ * @param removed_items list of vehicle data items to set
+ */
+ void SetRemovedCustomVdItems(
+ const policy_table::VehicleDataItems& removed_items);
+
void PersistData();
/**
@@ -945,6 +966,7 @@ class CacheManager : public CacheManagerInterface {
bool update_required;
typedef std::set<std::string> UnpairedDevices;
UnpairedDevices is_unpaired_;
+ policy_table::VehicleDataItems removed_custom_vd_items_;
mutable sync_primitives::RecursiveLock cache_lock_;
sync_primitives::Lock unpaired_lock_;
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 bd03896bfb..a1b4af0f39 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
@@ -162,6 +162,13 @@ class CacheManagerInterface {
const = 0;
/**
+ * @brief Gets vehicle data items removed after the last PTU
+ * @return List of removed vehicle data items
+ */
+ virtual std::vector<policy_table::VehicleDataItem>
+ GetRemovedVehicleDataItems() const = 0;
+
+ /**
* @brief Get a list of enabled cloud applications
* @param enabled_apps List filled with the policy app id of each enabled
* cloud application
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 178de4a8f0..fc6ec369dc 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
@@ -663,6 +663,9 @@ class PolicyManagerImpl : public PolicyManager {
const std::vector<policy_table::VehicleDataItem> GetVehicleDataItems()
const OVERRIDE;
+ std::vector<policy_table::VehicleDataItem> GetRemovedVehicleDataItems()
+ const OVERRIDE;
+
/**
* @brief Gets copy of current policy table data
* @return policy_table as json object