1*e4a36f41SAndroid Build Coastguard Worker# wificond 2*e4a36f41SAndroid Build Coastguard Workertype wificond, domain; 3*e4a36f41SAndroid Build Coastguard Workertype wificond_exec, system_file_type, exec_type, file_type; 4*e4a36f41SAndroid Build Coastguard Worker 5*e4a36f41SAndroid Build Coastguard Workerbinder_use(wificond) 6*e4a36f41SAndroid Build Coastguard Workerbinder_call(wificond, system_server) 7*e4a36f41SAndroid Build Coastguard Workerbinder_call(wificond, keystore) 8*e4a36f41SAndroid Build Coastguard Worker 9*e4a36f41SAndroid Build Coastguard Workeradd_service(wificond, wifinl80211_service) 10*e4a36f41SAndroid Build Coastguard Workerhal_client_domain(wificond, hal_nlinterceptor) 11*e4a36f41SAndroid Build Coastguard Worker 12*e4a36f41SAndroid Build Coastguard Worker# create sockets to set interfaces up and down 13*e4a36f41SAndroid Build Coastguard Workerallow wificond self:udp_socket create_socket_perms; 14*e4a36f41SAndroid Build Coastguard Worker# setting interface state up/down is a privileged ioctl 15*e4a36f41SAndroid Build Coastguard Workerallowxperm wificond self:udp_socket ioctl { SIOCSIFFLAGS SIOCSIFHWADDR }; 16*e4a36f41SAndroid Build Coastguard Workerallow wificond self:global_capability_class_set { net_admin net_raw }; 17*e4a36f41SAndroid Build Coastguard Worker# allow wificond to speak to nl80211 in the kernel 18*e4a36f41SAndroid Build Coastguard Workerallow wificond self:netlink_socket create_socket_perms_no_ioctl; 19*e4a36f41SAndroid Build Coastguard Worker# newer kernels (e.g. 4.4 but not 4.1) have a new class for sockets 20*e4a36f41SAndroid Build Coastguard Workerallow wificond self:netlink_generic_socket create_socket_perms_no_ioctl; 21*e4a36f41SAndroid Build Coastguard Worker 22*e4a36f41SAndroid Build Coastguard Workerr_dir_file(wificond, proc_net_type) 23*e4a36f41SAndroid Build Coastguard Worker 24*e4a36f41SAndroid Build Coastguard Worker# allow wificond to check permission for dumping logs 25*e4a36f41SAndroid Build Coastguard Workerallow wificond permission_service:service_manager find; 26*e4a36f41SAndroid Build Coastguard Worker 27*e4a36f41SAndroid Build Coastguard Worker# dumpstate support 28*e4a36f41SAndroid Build Coastguard Workerallow wificond dumpstate:fd use; 29*e4a36f41SAndroid Build Coastguard Workerallow wificond dumpstate:fifo_file write; 30*e4a36f41SAndroid Build Coastguard Worker 31*e4a36f41SAndroid Build Coastguard Worker#### Offer the Wifi Keystore HwBinder service ### 32*e4a36f41SAndroid Build Coastguard Workerhwbinder_use(wificond) 33*e4a36f41SAndroid Build Coastguard Workertypeattribute wificond wifi_keystore_service_server; 34*e4a36f41SAndroid Build Coastguard Workeradd_hwservice(wificond, system_wifi_keystore_hwservice) 35*e4a36f41SAndroid Build Coastguard Worker 36*e4a36f41SAndroid Build Coastguard Worker# Allow keystore binder access to serve the HwBinder service. 37*e4a36f41SAndroid Build Coastguard Workerallow wificond keystore_service:service_manager find; 38*e4a36f41SAndroid Build Coastguard Workerallow wificond keystore:keystore_key get; 39*e4a36f41SAndroid Build Coastguard Worker 40*e4a36f41SAndroid Build Coastguard Worker# Allow keystore2 binder access to serve the HwBinder service. 41*e4a36f41SAndroid Build Coastguard Workerallow wificond wifi_key:keystore2_key { 42*e4a36f41SAndroid Build Coastguard Worker get_info 43*e4a36f41SAndroid Build Coastguard Worker use 44*e4a36f41SAndroid Build Coastguard Worker}; 45