blob: d867e052aa7d5a5125a41cce809dc4e2254adc9a [file] [log] [blame]
Zvikomborero VIncent Zvikarambaa25011a2016-07-21 16:32:35 -04001# Bluetooth executables and scripts
2type bluetooth_loader, domain;
3type bluetooth_loader_exec, exec_type, file_type;
4
5# Start bdAddrLoader from init
6init_daemon_domain(bluetooth_loader)
7
8# Run init.qcom.bt.sh
9allow bluetooth_loader shell_exec:file { entrypoint read };
10allow bluetooth_loader bluetooth_loader_exec:file { getattr open execute_no_trans };
11
12# init.qcom.bt.sh needs /system/bin/log access
13allow bluetooth_loader devpts:chr_file rw_file_perms;
14
15# Run hci_qcomm_init from init.qcom.bt.sh
16domain_auto_trans(bluetooth_loader, hci_attach_exec, hci_attach)
17allow hci_attach bluetooth_loader:fd use;
18
19# Read mac address from persist partition
20allow bluetooth_loader persist_file:dir search;
21r_dir_file(bluetooth_loader, bluetooth_data_file)
22allow bluetooth_loader self:capability { dac_override dac_read_search chown };
23
24# It may write a random mac here
25allow bluetooth_loader persist_file:dir { add_name write };
26allow bluetooth_loader persist_file:file { create_file_perms };
27
28# Talk to init over the property socket
29unix_socket_connect(bluetooth_loader, property, init)
30# Set persist.service.bdroid.* and bluetooth.* property values
31allow bluetooth_loader bluetooth_prop:property_service set;
32
33# Allow getprop/setprop for init.qcom.bt.sh
34allow bluetooth_loader system_file:file execute_no_trans;
35
36# Access the smd device
37allow bluetooth_loader hci_attach_dev:chr_file rw_file_perms;
38
39# And qmuxd
40allow bluetooth_loader qmuxd_socket:dir { write add_name remove_name search };
41allow bluetooth_loader qmuxd_socket:sock_file { create setattr getattr write unlink };
42allow bluetooth_loader qmuxd:unix_stream_socket { connectto };
43#