Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b38d6e92 authored by Yifan Hong's avatar Yifan Hong Committed by Automerger Merge Worker
Browse files

health: Update README.md for SELinux rule example am: d4ebad8a am: a68e416f am: c8b2bc63

Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1894882

Change-Id: I0f19dfa8a7df70b3b88f04b3a0e6b55f3e806524
parents e3d00ca7 c8b2bc63
Loading
Loading
Loading
Loading
+17 −0
Original line number Original line Diff line number Diff line
@@ -162,9 +162,26 @@ Add device specific permissions to the domain where the health HAL
process is executed, especially if a device-specific `libhealthd` is used
process is executed, especially if a device-specific `libhealthd` is used
and/or device-specific storage related APIs are implemented.
and/or device-specific storage related APIs are implemented.


Example (assuming that your health AIDL service runs in domain
`hal_health_tuna`:

```text
type hal_health_tuna, domain;
hal_server_domain(hal_health_tuna, hal_health)
type hal_health_tuna_exec, exec_type, vendor_file_type, file_type;

# allow hal_health_tuna ...;
```

If you did not define a separate domain, the domain is likely
If you did not define a separate domain, the domain is likely
`hal_health_default`. The device-specific rules for it is likely at
`hal_health_default`. The device-specific rules for it is likely at
`device/<manufacturer>/<device>/sepolicy/vendor/hal_health_default.te`.
`device/<manufacturer>/<device>/sepolicy/vendor/hal_health_default.te`.
In this case, the aforementioned SELinux rules and types has already been
defined. You only need to add device-specific permissions.

```text
# allow hal_health_default ...;
```


### Implementing charger {#charger}
### Implementing charger {#charger}