Fix avc denied to dump some useful hals for user build.

To get thermal/power/power_stats hals debug info in user build.

Bug: 134545528
Test: tested in userdebug with dumpstate.unroot set to true
Change-Id: I612a28788277070fdebf819c0cadaa164fa629c0
diff --git a/public/te_macros b/public/te_macros
new file mode 100644
index 0000000..701ef55
--- /dev/null
+++ b/public/te_macros
@@ -0,0 +1,9 @@
+###########################################
+# dump_hal(hal_type)
+# Ability to dump the hal debug info
+#
+define(`dump_hal', `
+  hal_client_domain(dumpstate, $1);
+  allow $1_server dumpstate:fifo_file write;
+  allow $1_server dumpstate:fd use;
+')
diff --git a/vendor/qcom/common/dumpstate.te b/vendor/qcom/common/dumpstate.te
index e515e04..1fd1641 100644
--- a/vendor/qcom/common/dumpstate.te
+++ b/vendor/qcom/common/dumpstate.te
@@ -1,3 +1,7 @@
+dump_hal(hal_thermal)
+dump_hal(hal_power)
+dump_hal(hal_power_stats)
+
 userdebug_or_eng(`
   allow dumpstate proc_modules:file r_file_perms;
   allow dumpstate proc_stat:file r_file_perms;