Alex Klyubin | 168435f | 2017-02-16 20:14:56 -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) |
Myles Watson | 671a0c3 | 2022-08-10 14:19:27 -0700 | [diff] [blame] | 4 | binder_call(hal_bluetooth_server, servicemanager) |
Andre Eisenbach | be27f92 | 2016-10-12 14:49:56 -0700 | [diff] [blame] | 5 | |
Steven Moreland | 9234e00 | 2018-06-06 09:30:18 -0700 | [diff] [blame] | 6 | hal_attribute_hwservice(hal_bluetooth, hal_bluetooth_hwservice) |
Myles Watson | 671a0c3 | 2022-08-10 14:19:27 -0700 | [diff] [blame] | 7 | hal_attribute_service(hal_bluetooth, hal_bluetooth_service) |
Alex Klyubin | 53656c1 | 2017-04-13 19:05:27 -0700 | [diff] [blame] | 8 | |
Andre Eisenbach | be27f92 | 2016-10-12 14:49:56 -0700 | [diff] [blame] | 9 | wakelock_use(hal_bluetooth); |
| 10 | |
Myles Watson | 20b8d6b | 2017-02-22 11:50:20 -0800 | [diff] [blame] | 11 | # The HAL toggles rfkill to power the chip off/on. |
Benjamin Gordon | 9b2e0cb | 2017-11-09 15:51:26 -0700 | [diff] [blame] | 12 | allow hal_bluetooth self:global_capability_class_set net_admin; |
Myles Watson | 20b8d6b | 2017-02-22 11:50:20 -0800 | [diff] [blame] | 13 | |
Andre Eisenbach | be27f92 | 2016-10-12 14:49:56 -0700 | [diff] [blame] | 14 | # bluetooth factory file accesses. |
| 15 | r_dir_file(hal_bluetooth, bluetooth_efs_file) |
| 16 | |
| 17 | allow hal_bluetooth { uhid_device hci_attach_dev }:chr_file rw_file_perms; |
| 18 | |
Andre Eisenbach | be27f92 | 2016-10-12 14:49:56 -0700 | [diff] [blame] | 19 | # sysfs access. |
| 20 | r_dir_file(hal_bluetooth, sysfs_type) |
| 21 | allow hal_bluetooth sysfs_bluetooth_writable:file rw_file_perms; |
Benjamin Gordon | 9b2e0cb | 2017-11-09 15:51:26 -0700 | [diff] [blame] | 22 | allow hal_bluetooth self:global_capability2_class_set wake_alarm; |
Andre Eisenbach | be27f92 | 2016-10-12 14:49:56 -0700 | [diff] [blame] | 23 | |
| 24 | # Allow write access to bluetooth-specific properties |
Jaekyun Seok | 224921d | 2018-04-09 12:07:32 +0900 | [diff] [blame] | 25 | set_prop(hal_bluetooth, bluetooth_a2dp_offload_prop) |
Cheney Ni | e55a74b | 2019-03-18 11:07:32 +0800 | [diff] [blame] | 26 | set_prop(hal_bluetooth, bluetooth_audio_hal_prop) |
Ted Wang | c531cfc | 2024-09-16 10:49:32 +0000 | [diff] [blame^] | 27 | set_prop(hal_bluetooth, bluetooth_finder_prop) |
Andre Eisenbach | be27f92 | 2016-10-12 14:49:56 -0700 | [diff] [blame] | 28 | set_prop(hal_bluetooth, bluetooth_prop) |
Jaekyun Seok | 224921d | 2018-04-09 12:07:32 +0900 | [diff] [blame] | 29 | set_prop(hal_bluetooth, exported_bluetooth_prop) |
Andre Eisenbach | 6e3a5d0 | 2017-02-07 20:30:40 -0800 | [diff] [blame] | 30 | |
| 31 | # /proc access (bluesleep etc.). |
| 32 | allow hal_bluetooth proc_bluetooth_writable:file rw_file_perms; |
Martijn Coenen | 0d1f7d2 | 2017-05-09 09:53:46 -0700 | [diff] [blame] | 33 | |
| 34 | # allow to run with real-time scheduling policy |
Benjamin Gordon | 9b2e0cb | 2017-11-09 15:51:26 -0700 | [diff] [blame] | 35 | allow hal_bluetooth self:global_capability_class_set sys_nice; |