healthd provides health@2.0 service.

* remove binder calls to healthd (storaged, system_server)
* Allow healthd to serve health HAL

Bug: 62229583
Test: no health related denials
Test: VTS health test
Test: BatteryManagerTest

Change-Id: I0cf1872c0ba69e7de7c3f529d548f9ffe39812ac
diff --git a/private/healthd.te b/private/healthd.te
index 0693a3a..20d0791 100644
--- a/private/healthd.te
+++ b/private/healthd.te
@@ -2,5 +2,5 @@
 
 init_daemon_domain(healthd)
 
-# Allow callback to storaged batteryproperties listener
-binder_call(healthd, storaged)
+# Allow healthd to serve health HAL
+hal_server_domain(healthd, hal_health)
diff --git a/private/storaged.te b/private/storaged.te
index 8da1f26..96d59d9 100644
--- a/private/storaged.te
+++ b/private/storaged.te
@@ -40,9 +40,7 @@
 binder_use(storaged)
 binder_call(storaged, system_server)
 
-# use batteryproperties service
-allow storaged batteryproperties_service:service_manager find;
-binder_call(storaged, healthd)
+hal_client_domain(storaged, hal_health)
 
 # Implements a dumpsys interface.
 allow storaged dumpstate:fd use;
diff --git a/public/healthd.te b/public/healthd.te
index c0a7bec..7f99c9f 100644
--- a/public/healthd.te
+++ b/public/healthd.te
@@ -21,9 +21,6 @@
 
 wakelock_use(healthd)
 
-binder_use(healthd)
-binder_service(healthd)
-binder_call(healthd, system_server)
 hal_client_domain(healthd, hal_health)
 
 # Write to state file.
@@ -56,8 +53,6 @@
 allow healthd self:process execmem;
 allow healthd proc_sysrq:file rw_file_perms;
 
-add_service(healthd, batteryproperties_service)
-
 # Healthd needs to tell init to continue the boot
 # process when running in charger mode.
 set_prop(healthd, system_prop)