Merge "Seandroid: Add policy for dts configurator and notifier nodes"
diff --git a/Android.mk b/Android.mk
index d21253b..86b11be 100755
--- a/Android.mk
+++ b/Android.mk
@@ -95,7 +95,8 @@
        kernel.te \
        vold.te \
        wfdservice.te \
-       usf.te
+       usf.te \
+       dtsconfigurator.te
 
 # Compile sensor pilicy only for SSC targets
 SSC_TARGET_LIST := apq8084
diff --git a/common/dtsconfigurator.te b/common/dtsconfigurator.te
new file mode 100755
index 0000000..2f1e249
--- /dev/null
+++ b/common/dtsconfigurator.te
@@ -0,0 +1,8 @@
+type dtsconfigurator, domain;
+type dtsconfigurator_exec, exec_type, file_type;
+
+#started by init
+init_daemon_domain(dtsconfigurator)
+
+allow dtsconfigurator audio_device:dir r_dir_perms;
+allow dtsconfigurator audio_device:chr_file rw_file_perms;
diff --git a/common/file.te b/common/file.te
index 2f53e43..7d4bfc0 100644
--- a/common/file.te
+++ b/common/file.te
@@ -122,3 +122,6 @@
 #Define the files written during the operation of usf
 type usf_data_file, file_type, data_file_type;
 type persist_usf_file, file_type;
+
+# dts notifier files
+type dts_data_file, file_type, data_file_type;
diff --git a/common/file_contexts b/common/file_contexts
index d5c6757..7e4d1f2 100644
--- a/common/file_contexts
+++ b/common/file_contexts
@@ -167,6 +167,7 @@
 /system/bin/gpsone_daemon                       u:object_r:location_exec:s0
 /system/vendor/bin/slim_ap_daemon               u:object_r:location_exec:s0
 /system/bin/energy-awareness                    u:object_r:energyawareness_exec:s0
+/system/bin/dts_configurator                    u:object_r:dtsconfigurator_exec:s0
 /system/vendor/bin/qti                          u:object_r:qti_exec:s0
 /system/bin/wcnss_service                       u:object_r:wcnss_service_exec:s0
 /system/vendor/bin/hbtp_daemon                  u:object_r:hbtp_exec:s0
@@ -250,6 +251,7 @@
 /data/misc/hbtp(/.*)?                                               u:object_r:hbtp_log_file:s0
 /data/misc/qlogd(/.*)?                                              u:object_r:qlogd_data_file:s0
 /data/usf(/.*)?                                                     u:object_r:usf_data_file:s0
+/data/misc/dts(/.*)?                                                u:object_r:dts_data_file:s0
 
 ###################################
 # persist files
diff --git a/common/mediaserver.te b/common/mediaserver.te
index 07f8f86..e33f222 100644
--- a/common/mediaserver.te
+++ b/common/mediaserver.te
@@ -21,6 +21,11 @@
 allow mediaserver sysfs_esoc:dir r_dir_perms;
 allow mediaserver sysfs_esoc:lnk_file read;
 allow mediaserver system_app_data_file:file rw_file_perms;
+
+# allow mediaserver to write DTS files
+allow mediaserver dts_data_file:dir rw_dir_perms;
+allow mediaserver dts_data_file:file create_file_perms;
+
 # access to perflock
 allow mediaserver mpctl_socket:dir r_dir_perms;
 unix_socket_send(mediaserver, mpctl, mpdecision)
diff --git a/common/system_app.te b/common/system_app.te
index fc38838..f7e4cef 100644
--- a/common/system_app.te
+++ b/common/system_app.te
@@ -33,6 +33,10 @@
 # access to color service SDK
 allow system_app color_service:service_manager add;
 
+# system app to access DTS data files
+allow system_app dts_data_file:dir r_dir_perms;
+allow system_app dts_data_file:file r_file_perms;
+
 # access to firmware file
 userdebug_or_eng(`
   r_dir_file(system_app, firmware_file);