summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRick Yiu <rickyiu@google.com>2019-06-14 16:37:41 +0800
committerRick Yiu <rickyiu@google.com>2019-06-14 16:37:41 +0800
commit7caa0ca4339503e83cfabd25e443e4c8789ab5ef (patch)
tree0fd007cb78ce05e8f34f3684eee6fd14fcc0222a
parentfcbdf0a464410771f0e19c24b84d375a08739be8 (diff)
downloaddevice_google_wahoo-7caa0ca4339503e83cfabd25e443e4c8789ab5ef.tar.gz
device_google_wahoo-7caa0ca4339503e83cfabd25e443e4c8789ab5ef.tar.bz2
device_google_wahoo-7caa0ca4339503e83cfabd25e443e4c8789ab5ef.zip
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: I5594bb7b1a444529c6c4fa0e566b9aeca9792fb4
-rw-r--r--sepolicy/public/te_macros9
-rw-r--r--sepolicy/vendor/dumpstate.te4
2 files changed, 13 insertions, 0 deletions
diff --git a/sepolicy/public/te_macros b/sepolicy/public/te_macros
new file mode 100644
index 00000000..701ef555
--- /dev/null
+++ b/sepolicy/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/sepolicy/vendor/dumpstate.te b/sepolicy/vendor/dumpstate.te
index faa81a65..a0a8af40 100644
--- a/sepolicy/vendor/dumpstate.te
+++ b/sepolicy/vendor/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;