blob: aa9f0fea09b19bed3bcdb98e1d463c957a6ec02c [file] [log] [blame]
Ravi Kumar Siddojigarif9eefc62014-12-03 17:13:31 +05301#Adding all bt related service to bt domains
Biswajit Paul6786a922017-03-16 11:53:53 -07002type sapd, bluetoothdomain;
Ravi Kumar Siddojigaric7def122017-06-13 00:49:19 +05303type sapd_exec, exec_type, vendor_file_type, file_type;
Ravi Kumar Siddojigarif9eefc62014-12-03 17:13:31 +05304
Biswajit Paul6786a922017-03-16 11:53:53 -07005type btsnoop, bluetoothdomain;
Ravi Kumar Siddojigaric7def122017-06-13 00:49:19 +05306type btsnoop_exec, exec_type, vendor_file_type, file_type;
Ravi Kumar Siddojigarif9eefc62014-12-03 17:13:31 +05307
Biswajit Paul6786a922017-03-16 11:53:53 -07008type btnvtool, bluetoothdomain;
Ravi Kumar Siddojigaric7def122017-06-13 00:49:19 +05309type btnvtool_exec, exec_type, vendor_file_type, file_type;
Srinu Jella163b0022015-11-13 14:56:55 +053010
Biswajit Paul6786a922017-03-16 11:53:53 -070011type fmhal_service, bluetoothdomain;
Ravi Kumar Siddojigaric7def122017-06-13 00:49:19 +053012type fmhal_service_exec, exec_type, vendor_file_type, file_type;
Satish kumar sugasi496eac32016-05-10 12:22:19 -070013
Michael Bestasfc211fc2017-08-08 21:18:48 +030014set_prop(bluetooth, bluetooth_prop)
Srinu Jella6ab75702017-08-01 19:56:10 +053015allow bluetooth sysfs_bluetooth_writable:file w_file_perms;
Vadivel Thekkamalai823d2f32014-10-15 17:38:32 -070016
Avijit Kanti Das441bad42015-05-12 14:07:41 -070017#Access to /data/media
18allow bluetooth media_rw_data_file:dir create_dir_perms;
19allow bluetooth media_rw_data_file:file create_file_perms;
Sungjun Park9a648c92015-04-19 22:29:16 -070020#allow proc_sysrq access for crash dump
21userdebug_or_eng(`
22 allow bluetooth proc_sysrq:file w_file_perms;
Ravi Kumar Siddojigari92eed182017-06-27 00:25:03 +053023 allow bluetooth qti_debugfs:file r_file_perms;
Sungjun Park9a648c92015-04-19 22:29:16 -070024')
Vadivel Thekkamalai823d2f32014-10-15 17:38:32 -070025
Avijit Kanti Das441bad42015-05-12 14:07:41 -070026allow bluetooth {
27 uhid_device
David Nga658efb2016-10-07 11:38:22 -070028 #input_device
Avijit Kanti Das441bad42015-05-12 14:07:41 -070029 serial_device
30 #BT needes read and write on smd device node
31 smd_device
Satish kumar sugasi0c22d0a2016-10-04 20:36:59 -070032 bt_device
Avijit Kanti Das441bad42015-05-12 14:07:41 -070033}:chr_file rw_file_perms;
Vadivel Thekkamalai823d2f32014-10-15 17:38:32 -070034
Avijit Kanti Das441bad42015-05-12 14:07:41 -070035#Access to persist_file
Srinu Jella163b0022015-11-13 14:56:55 +053036allow bluetooth persist_bluetooth_file:dir rw_dir_perms;
37allow bluetooth persist_bluetooth_file:file create_file_perms;
Avijit Kanti Das441bad42015-05-12 14:07:41 -070038r_dir_file(bluetooth, persist_file)
39allow bluetooth persist_file:file w_file_perms;
Vadivel Thekkamalaif84e6092014-10-22 10:58:20 -070040
Biswajit Paul2d35d982017-02-01 17:40:10 -080041allow bluetooth self:socket { create write getopt read };
Srinu Jella163b0022015-11-13 14:56:55 +053042
Sungjun Parke5b57392014-12-26 11:53:41 -080043#For bluetooth firmware
Avijit Kanti Das441bad42015-05-12 14:07:41 -070044r_dir_file(bluetooth, bt_firmware_file)
Ravi Kumar Siddojigarif9eefc62014-12-03 17:13:31 +053045
46#dun-server requires binding with system_app and servicemanager
47binder_use(bluetooth);
48binder_call(bluetooth, system_app);
49binder_call(bluetooth, servicemanager);
Hemant Guptaafd43ce2015-09-09 11:48:22 +053050allow bluetooth dun_service:service_manager find;
Ravi Kumar Siddojigarif9eefc62014-12-03 17:13:31 +053051
52#sapd requires interaction with qmux sockets
Ravi Kumar Siddojigaric7def122017-06-13 00:49:19 +053053#qmux_socket(bluetooth);
Avijit Kanti Das23d6b672015-09-04 15:45:59 -070054
55# for finding wbc_service
56allow bluetooth wbc_service:service_manager find;
taozhangaf844b82015-11-04 14:50:25 +080057
58# for fastmmi test bluetooth
Ravi Kumar Siddojigaric7def122017-06-13 00:49:19 +053059#allow bluetooth mmi:unix_stream_socket connectto;
Kiran Kelageri8dd139f2016-04-07 12:08:20 -070060#connect to wcnss_filter
Ravi Kumar Siddojigaric7def122017-06-13 00:49:19 +053061#allow bluetooth wcnss_filter:unix_stream_socket connectto;
Biswajit Paulf63bd142017-03-16 16:41:02 -070062
63# ioctlcmd=c302
64allow bluetooth self:socket ioctl;
65allowxperm bluetooth self:socket ioctl msm_sock_ipc_ioctls;
pramod kotreshappa730a6b72017-04-28 17:20:17 -070066
67#SplitA2dp bluetooth requires binding with audio hal
68binder_call(bluetooth, hal_audio);
69allow bluetooth hal_audio_hwservice:hwservice_manager find;