yukawa: Add default thermal HAL Ver 1.0

Bug: 144035870
Test: Manual

Change-Id: Iea3d83dd26002accfe6416cd05aa32a95587b301
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
diff --git a/device-common.mk b/device-common.mk
index a36074e..3b39c6e 100644
--- a/device-common.mk
+++ b/device-common.mk
@@ -147,6 +147,12 @@
     android.hardware.power@1.0-impl \
     android.hardware.power@1.0-service
 
+# ThermalHAL
+PRODUCT_PACKAGES += \
+    thermal.default \
+    android.hardware.thermal@1.0-impl \
+    android.hardware.thermal@1.0-service
+
 # Software Gatekeeper HAL
 PRODUCT_PACKAGES += \
     android.hardware.gatekeeper@1.0-service.software
diff --git a/manifest.xml b/manifest.xml
index cf7c024..9f97b26 100755
--- a/manifest.xml
+++ b/manifest.xml
@@ -183,4 +183,13 @@
             <instance>default</instance>
         </interface>
     </hal>
+    <hal format="hidl">
+        <name>android.hardware.thermal</name>
+        <transport>hwbinder</transport>
+        <version>1.0</version>
+        <interface>
+            <name>IThermal</name>
+            <instance>default</instance>
+        </interface>
+    </hal>
 </manifest>
diff --git a/sepolicy/file_contexts b/sepolicy/file_contexts
index 8f75614..e54b229 100644
--- a/sepolicy/file_contexts
+++ b/sepolicy/file_contexts
@@ -6,6 +6,9 @@
 /dev/cec0              u:object_r:cec_device:s0
 /dev/i2c-0             u:object_r:led_device:s0
 
+/sys/devices/virtual/thermal(/.*)?      u:object_r:sysfs_thermal:s0
+/sys/class/thermal(/.*)?                u:object_r:sysfs_thermal:s0
+
 # files in /vendor
 /(vendor|system/vendor)/lib(64)?/hw/gralloc\.yukawa\.so u:object_r:same_process_hal_file:s0
 /vendor/bin/hw/android\.hardware\.health@2\.0-service\.yukawa u:object_r:hal_health_default_exec:s0
diff --git a/sepolicy/hal_thermal_default.te b/sepolicy/hal_thermal_default.te
new file mode 100644
index 0000000..482668b
--- /dev/null
+++ b/sepolicy/hal_thermal_default.te
@@ -0,0 +1,4 @@
+allow hal_thermal_default sysfs_thermal:dir r_dir_perms;
+allow hal_thermal_default sysfs_thermal:file rw_file_perms;
+allow hal_thermal_default sysfs_thermal:lnk_file read;
+allow hal_thermal_default proc_stat:file r_file_perms;