Dan Cashman | 8058248 | 2017-12-06 09:20:27 -0800 | [diff] [blame] | 1 | # HwBinder IPC from clients into server, and callbacks |
| 2 | binder_call(hal_bluetooth_client, hal_bluetooth_server) |
| 3 | binder_call(hal_bluetooth_server, hal_bluetooth_client) |
| 4 | |
| 5 | add_hwservice(hal_bluetooth_server, hal_bluetooth_hwservice) |
| 6 | allow hal_bluetooth_client hal_bluetooth_hwservice:hwservice_manager find; |
| 7 | |
| 8 | wakelock_use(hal_bluetooth); |
| 9 | |
| 10 | # The HAL toggles rfkill to power the chip off/on. |
| 11 | allow hal_bluetooth self:capability net_admin; |
| 12 | |
| 13 | # bluetooth factory file accesses. |
| 14 | r_dir_file(hal_bluetooth, bluetooth_efs_file) |
| 15 | |
| 16 | allow hal_bluetooth { uhid_device hci_attach_dev }:chr_file rw_file_perms; |
| 17 | |
| 18 | # sysfs access. |
| 19 | r_dir_file(hal_bluetooth, sysfs_type) |
| 20 | allow hal_bluetooth sysfs_bluetooth_writable:file rw_file_perms; |
| 21 | allow hal_bluetooth self:capability2 wake_alarm; |
| 22 | |
| 23 | # Allow write access to bluetooth-specific properties |
| 24 | set_prop(hal_bluetooth, bluetooth_prop) |
| 25 | |
| 26 | # /proc access (bluesleep etc.). |
| 27 | allow hal_bluetooth proc_bluetooth_writable:file rw_file_perms; |
| 28 | |
| 29 | # allow to run with real-time scheduling policy |
| 30 | allow hal_bluetooth self:capability sys_nice; |