Allow thermal_engine to /dev/msm_thermal_query

Bug: 14139855
Change-Id: Iac864b4d5e19254c9abc79f5c79cde6873563578
diff --git a/sepolicy/device.te b/sepolicy/device.te
index 68735aa..592f0b4 100644
--- a/sepolicy/device.te
+++ b/sepolicy/device.te
@@ -14,3 +14,6 @@
 type rtc, dev_type;
 
 type modem_block_device, dev_type;
+
+# Thermal engine
+type thermal_engine_device, dev_type;
diff --git a/sepolicy/file_contexts b/sepolicy/file_contexts
index b5232f8..8d9e755 100644
--- a/sepolicy/file_contexts
+++ b/sepolicy/file_contexts
@@ -145,3 +145,6 @@
 
 # Bluetooth
 /sys/devices/platform/bluetooth_rfkill/rfkill/rfkill0/state u:object_r:sysfs_bluetooth_writable:s0
+
+# Thermal engine
+/dev/msm_thermal_query            u:object_r:thermal_engine_device:s0
diff --git a/sepolicy/thermald.te b/sepolicy/thermald.te
index a8fcc66..78ebfae 100644
--- a/sepolicy/thermald.te
+++ b/sepolicy/thermald.te
@@ -43,3 +43,6 @@
 # Connect to mpdecision.
 allow thermald mpdecision_socket:dir r_dir_perms;
 unix_socket_connect(thermald, mpdecision, mpdecision)
+
+# Access to /dev/msm_thermal_query
+allow thermald thermal_engine_device:chr_file rw_file_perms;