xref: /aosp_15_r20/system/sepolicy/private/hal_bluetooth.te (revision e4a36f4174b17bbab9dc043f4a65dc8d87377290)
1*e4a36f41SAndroid Build Coastguard Worker# HwBinder IPC from clients into server, and callbacks
2*e4a36f41SAndroid Build Coastguard Workerbinder_call(hal_bluetooth_client, hal_bluetooth_server)
3*e4a36f41SAndroid Build Coastguard Workerbinder_call(hal_bluetooth_server, hal_bluetooth_client)
4*e4a36f41SAndroid Build Coastguard Workerbinder_call(hal_bluetooth_server, servicemanager)
5*e4a36f41SAndroid Build Coastguard Worker
6*e4a36f41SAndroid Build Coastguard Workerhal_attribute_hwservice(hal_bluetooth, hal_bluetooth_hwservice)
7*e4a36f41SAndroid Build Coastguard Workerhal_attribute_service(hal_bluetooth, hal_bluetooth_service)
8*e4a36f41SAndroid Build Coastguard Worker
9*e4a36f41SAndroid Build Coastguard Workerwakelock_use(hal_bluetooth);
10*e4a36f41SAndroid Build Coastguard Worker
11*e4a36f41SAndroid Build Coastguard Worker# The HAL toggles rfkill to power the chip off/on.
12*e4a36f41SAndroid Build Coastguard Workerallow hal_bluetooth self:global_capability_class_set net_admin;
13*e4a36f41SAndroid Build Coastguard Worker
14*e4a36f41SAndroid Build Coastguard Worker# bluetooth factory file accesses.
15*e4a36f41SAndroid Build Coastguard Workerr_dir_file(hal_bluetooth, bluetooth_efs_file)
16*e4a36f41SAndroid Build Coastguard Worker
17*e4a36f41SAndroid Build Coastguard Workerallow hal_bluetooth { uhid_device hci_attach_dev }:chr_file rw_file_perms;
18*e4a36f41SAndroid Build Coastguard Worker
19*e4a36f41SAndroid Build Coastguard Worker# sysfs access.
20*e4a36f41SAndroid Build Coastguard Workerr_dir_file(hal_bluetooth, sysfs_type)
21*e4a36f41SAndroid Build Coastguard Workerallow hal_bluetooth sysfs_bluetooth_writable:file rw_file_perms;
22*e4a36f41SAndroid Build Coastguard Workerallow hal_bluetooth self:global_capability2_class_set wake_alarm;
23*e4a36f41SAndroid Build Coastguard Worker
24*e4a36f41SAndroid Build Coastguard Worker# Allow write access to bluetooth-specific properties
25*e4a36f41SAndroid Build Coastguard Workerset_prop(hal_bluetooth, bluetooth_a2dp_offload_prop)
26*e4a36f41SAndroid Build Coastguard Workerset_prop(hal_bluetooth, bluetooth_audio_hal_prop)
27*e4a36f41SAndroid Build Coastguard Workerset_prop(hal_bluetooth, bluetooth_finder_prop)
28*e4a36f41SAndroid Build Coastguard Workerset_prop(hal_bluetooth, bluetooth_prop)
29*e4a36f41SAndroid Build Coastguard Workerset_prop(hal_bluetooth, exported_bluetooth_prop)
30*e4a36f41SAndroid Build Coastguard Worker
31*e4a36f41SAndroid Build Coastguard Worker# /proc access (bluesleep etc.).
32*e4a36f41SAndroid Build Coastguard Workerallow hal_bluetooth proc_bluetooth_writable:file rw_file_perms;
33*e4a36f41SAndroid Build Coastguard Worker
34*e4a36f41SAndroid Build Coastguard Worker# allow to run with real-time scheduling policy
35*e4a36f41SAndroid Build Coastguard Workerallow hal_bluetooth self:global_capability_class_set sys_nice;
36