messaging policy added. Dash in policy names changed to underscore.
authorDmytro Lomtiev <d.lomtev@samsung.com>
Mon, 26 Mar 2018 09:22:10 +0000 (12:22 +0300)
committerDmytro Lomtiev <d.lomtev@samsung.com>
Mon, 26 Mar 2018 12:03:26 +0000 (15:03 +0300)
device-agent/daemon/dpm/dpm_api_mapper.cpp

index c898853..d5618c6 100644 (file)
@@ -18,6 +18,7 @@
 #include <vector>
 #include "policy_enforce.h"
 #include "integer_property_policy.h"
+#include "indexed_property_policy.h"
 #include "logging.h"
 #include "samonitor_tag.h"
 #include "dpm_api_mapper.h"
@@ -57,33 +58,32 @@ APIMapper APIMapper::dpm_api_mapper;
 APIMapper::APIMapper() {
     auto& enforce = dpm::PolicyEnforce::GetInstance();
 
-//    IntegerPropertyPolicy(enforce, "messaging", dpm_restriction_set_messaging_state, dpm_restriction_get_messaging_state),
-
     static auto mappings = std::make_tuple(
         PolicyHolder<IntegerPropertyPolicy>(enforce, std::string{"bluetooth"}, dpm_restriction_set_bluetooth_mode_change_state, dpm_restriction_get_bluetooth_mode_change_state),
-        PolicyHolder<IntegerPropertyPolicy>(enforce, std::string{"bluetooth-tethering"}, dpm_restriction_set_bluetooth_tethering_state, dpm_restriction_get_bluetooth_tethering_state),
-        PolicyHolder<IntegerPropertyPolicy>(enforce, "bluetooth-desktop-connectivity", dpm_restriction_set_bluetooth_desktop_connectivity_state, dpm_restriction_get_bluetooth_desktop_connectivity_state),
-        PolicyHolder<IntegerPropertyPolicy>(enforce, "bluetooth-pairing", dpm_restriction_set_bluetooth_pairing_state, dpm_restriction_get_bluetooth_pairing_state),
+        PolicyHolder<IntegerPropertyPolicy>(enforce, std::string{"bluetooth_tethering"}, dpm_restriction_set_bluetooth_tethering_state, dpm_restriction_get_bluetooth_tethering_state),
+        PolicyHolder<IntegerPropertyPolicy>(enforce, "bluetooth_desktop_connectivity", dpm_restriction_set_bluetooth_desktop_connectivity_state, dpm_restriction_get_bluetooth_desktop_connectivity_state),
+        PolicyHolder<IntegerPropertyPolicy>(enforce, "bluetooth_pairing", dpm_restriction_set_bluetooth_pairing_state, dpm_restriction_get_bluetooth_pairing_state),
         PolicyHolder<IntegerPropertyPolicy>(enforce, "browser", dpm_restriction_set_browser_state, dpm_restriction_get_browser_state),
         PolicyHolder<IntegerPropertyPolicy>(enforce, "camera", dpm_restriction_set_camera_state, dpm_restriction_get_camera_state),
         PolicyHolder<IntegerPropertyPolicy>(enforce, "clipboard", dpm_restriction_set_clipboard_state, dpm_restriction_get_clipboard_state),
-        PolicyHolder<IntegerPropertyPolicy>(enforce, "external-storage", dpm_restriction_set_external_storage_state, dpm_restriction_get_external_storage_state),
+        PolicyHolder<IntegerPropertyPolicy>(enforce, "external_storage", dpm_restriction_set_external_storage_state, dpm_restriction_get_external_storage_state),
         PolicyHolder<IntegerPropertyPolicy>(enforce, "location", dpm_restriction_set_location_state, dpm_restriction_get_location_state),
         PolicyHolder<IntegerPropertyPolicy>(enforce, "microphone", dpm_restriction_set_microphone_state, dpm_restriction_get_microphone_state),
-        PolicyHolder<IntegerPropertyPolicy>(enforce, "popimap-email", dpm_restriction_set_popimap_email_state, dpm_restriction_get_popimap_email_state),
-        PolicyHolder<IntegerPropertyPolicy>(enforce, "usb-tethering", dpm_restriction_set_usb_tethering_state, dpm_restriction_get_usb_tethering_state),
-        PolicyHolder<IntegerPropertyPolicy>(enforce, "password-history", dpm_password_set_history, dpm_password_get_history),
-        PolicyHolder<IntegerPropertyPolicy>(enforce, "password-minimum-length", dpm_password_set_minimum_length, dpm_password_get_minimum_length),
-        PolicyHolder<IntegerPropertyPolicy>(enforce, "password-minimum-complexity", dpm_password_set_min_complex_chars, dpm_password_get_min_complex_chars),
-        PolicyHolder<IntegerPropertyPolicy>(enforce, "password-inactivity-timeout", dpm_password_set_max_inactivity_time_device_lock, dpm_password_get_max_inactivity_time_device_lock),
-        PolicyHolder<IntegerPropertyPolicy>(enforce, "password-expired", dpm_password_set_expires, dpm_password_get_expires),
-        PolicyHolder<IntegerPropertyPolicy>(enforce, "password-maximum-failure-count", dpm_password_set_maximum_failed_attempts_for_wipe, dpm_password_get_maximum_failed_attempts_for_wipe),
-        PolicyHolder<IntegerPropertyPolicy>(enforce, "password-numeric-sequences-length", dpm_password_set_maximum_numeric_sequence_length, dpm_password_get_maximum_numeric_sequence_length),
-        PolicyHolder<IntegerPropertyPolicy>(enforce, "password-maximum-character-occurrences", dpm_password_set_maximum_character_occurrences, dpm_password_get_maximum_character_occurrences),
-        PolicyHolder<IntegerPropertyPolicy>(enforce, "password-quality", dpm_password_set_quality, dpm_password_get_quality),
+        PolicyHolder<IntegerPropertyPolicy>(enforce, "popimap_email", dpm_restriction_set_popimap_email_state, dpm_restriction_get_popimap_email_state),
+        PolicyHolder<IndexedPropertyPolicy>(enforce, "messaging", dpm_restriction_set_messaging_state, dpm_restriction_get_messaging_state),
+        PolicyHolder<IntegerPropertyPolicy>(enforce, "usb_tethering", dpm_restriction_set_usb_tethering_state, dpm_restriction_get_usb_tethering_state),
+        PolicyHolder<IntegerPropertyPolicy>(enforce, "password_history", dpm_password_set_history, dpm_password_get_history),
+        PolicyHolder<IntegerPropertyPolicy>(enforce, "password_minimum_length", dpm_password_set_minimum_length, dpm_password_get_minimum_length),
+        PolicyHolder<IntegerPropertyPolicy>(enforce, "password_minimum_complexity", dpm_password_set_min_complex_chars, dpm_password_get_min_complex_chars),
+        PolicyHolder<IntegerPropertyPolicy>(enforce, "password_inactivity_timeout", dpm_password_set_max_inactivity_time_device_lock, dpm_password_get_max_inactivity_time_device_lock),
+        PolicyHolder<IntegerPropertyPolicy>(enforce, "password_expired", dpm_password_set_expires, dpm_password_get_expires),
+        PolicyHolder<IntegerPropertyPolicy>(enforce, "password_maximum_failure_count", dpm_password_set_maximum_failed_attempts_for_wipe, dpm_password_get_maximum_failed_attempts_for_wipe),
+        PolicyHolder<IntegerPropertyPolicy>(enforce, "password_numeric_sequences_length", dpm_password_set_maximum_numeric_sequence_length, dpm_password_get_maximum_numeric_sequence_length),
+        PolicyHolder<IntegerPropertyPolicy>(enforce, "password_maximum_character_occurrences", dpm_password_set_maximum_character_occurrences, dpm_password_get_maximum_character_occurrences),
+        PolicyHolder<IntegerPropertyPolicy>(enforce, "password_quality", dpm_password_set_quality, dpm_password_get_quality),
         PolicyHolder<IntegerPropertyPolicy>(enforce, "wifi", dpm_restriction_set_wifi_state, dpm_restriction_get_wifi_state),
-        PolicyHolder<IntegerPropertyPolicy>(enforce, "wifi-tethering", dpm_restriction_set_wifi_hotspot_state, dpm_restriction_get_wifi_hotspot_state),
-        PolicyHolder<IntegerPropertyPolicy>(enforce, "wifi-profile-change", dpm_wifi_set_profile_change_restriction, dpm_wifi_is_profile_change_restricted)
+        PolicyHolder<IntegerPropertyPolicy>(enforce, "wifi_tethering", dpm_restriction_set_wifi_hotspot_state, dpm_restriction_get_wifi_hotspot_state),
+        PolicyHolder<IntegerPropertyPolicy>(enforce, "wifi_profile_change", dpm_wifi_set_profile_change_restriction, dpm_wifi_is_profile_change_restricted)
     );
 }