Add power.stats HAL 1.0 sepolicy

Also giving statsd permission to access it. This change copies the internal sepolicy to AOSP.

Bug: 111185513
Bug: 120551881
Test: make
Change-Id: I7e0386777e05580299caf9b97cb7804459f1a9d0
diff --git a/public/attributes b/public/attributes
index 6453d7b..37c2b94 100644
--- a/public/attributes
+++ b/public/attributes
@@ -275,6 +275,7 @@
 hal_attribute(oemlock);
 hal_attribute(omx);
 hal_attribute(power);
+hal_attribute(power_stats);
 hal_attribute(secure_element);
 hal_attribute(sensors);
 hal_attribute(system_suspend);
diff --git a/public/hal_power_stats.te b/public/hal_power_stats.te
new file mode 100644
index 0000000..2c04008
--- /dev/null
+++ b/public/hal_power_stats.te
@@ -0,0 +1,5 @@
+# HwBinder IPC from client to server, and callbacks
+binder_call(hal_power_stats_client, hal_power_stats_server)
+binder_call(hal_power_stats_server, hal_power_stats_client)
+
+hal_attribute_hwservice(hal_power_stats, hal_power_stats_hwservice)
diff --git a/public/hwservice.te b/public/hwservice.te
index 8ded06b..fa83862 100644
--- a/public/hwservice.te
+++ b/public/hwservice.te
@@ -38,6 +38,7 @@
 type hal_oemlock_hwservice, hwservice_manager_type;
 type hal_omx_hwservice, hwservice_manager_type;
 type hal_power_hwservice, hwservice_manager_type;
+type hal_power_stats_hwservice, hwservice_manager_type;
 type hal_renderscript_hwservice, hwservice_manager_type, same_process_hwservice;
 type hal_secure_element_hwservice, hwservice_manager_type;
 type hal_sensors_hwservice, hwservice_manager_type;
diff --git a/public/statsd.te b/public/statsd.te
index 603ee14..1006867 100644
--- a/public/statsd.te
+++ b/public/statsd.te
@@ -60,6 +60,7 @@
 allow statsd proc_uid_cputime_showstat:file { getattr open read };
 hal_client_domain(statsd, hal_health)
 hal_client_domain(statsd, hal_power)
+hal_client_domain(statsd, hal_power_stats)
 hal_client_domain(statsd, hal_thermal)
 
 # Allow 'adb shell cmd' to upload configs and download output.