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 Worker 11*e4a36f41SAndroid Build Coastguard Workerset_prop(wificond, exported_wifi_prop) 12*e4a36f41SAndroid Build Coastguard Workerset_prop(wificond, wifi_prop) 13*e4a36f41SAndroid Build Coastguard Workerset_prop(wificond, ctl_default_prop) 14*e4a36f41SAndroid Build Coastguard Worker 15*e4a36f41SAndroid Build Coastguard Worker# create sockets to set interfaces up and down 16*e4a36f41SAndroid Build Coastguard Workerallow wificond self:udp_socket create_socket_perms; 17*e4a36f41SAndroid Build Coastguard Worker# setting interface state up/down is a privileged ioctl 18*e4a36f41SAndroid Build Coastguard Workerallowxperm wificond self:udp_socket ioctl { SIOCSIFFLAGS SIOCSIFHWADDR }; 19*e4a36f41SAndroid Build Coastguard Workerallow wificond self:global_capability_class_set { net_admin net_raw }; 20*e4a36f41SAndroid Build Coastguard Worker# allow wificond to speak to nl80211 in the kernel 21*e4a36f41SAndroid Build Coastguard Workerallow wificond self:netlink_socket create_socket_perms_no_ioctl; 22*e4a36f41SAndroid Build Coastguard Worker# newer kernels (e.g. 4.4 but not 4.1) have a new class for sockets 23*e4a36f41SAndroid Build Coastguard Workerallow wificond self:netlink_generic_socket create_socket_perms_no_ioctl; 24*e4a36f41SAndroid Build Coastguard Worker 25*e4a36f41SAndroid Build Coastguard Workerr_dir_file(wificond, proc_net_type) 26*e4a36f41SAndroid Build Coastguard Worker 27*e4a36f41SAndroid Build Coastguard Worker# allow wificond to check permission for dumping logs 28*e4a36f41SAndroid Build Coastguard Workerallow wificond permission_service:service_manager find; 29*e4a36f41SAndroid Build Coastguard Worker 30*e4a36f41SAndroid Build Coastguard Worker# dumpstate support 31*e4a36f41SAndroid Build Coastguard Workerallow wificond dumpstate:fd use; 32*e4a36f41SAndroid Build Coastguard Workerallow wificond dumpstate:fifo_file write; 33*e4a36f41SAndroid Build Coastguard Worker 34*e4a36f41SAndroid Build Coastguard Worker#### Offer the Wifi Keystore HwBinder service ### 35*e4a36f41SAndroid Build Coastguard Workerhwbinder_use(wificond) 36*e4a36f41SAndroid Build Coastguard Workerget_prop(wificond, hwservicemanager_prop) 37*e4a36f41SAndroid Build Coastguard Workertypeattribute wificond wifi_keystore_service_server; 38*e4a36f41SAndroid Build Coastguard Workeradd_hwservice(wificond, system_wifi_keystore_hwservice) 39*e4a36f41SAndroid Build Coastguard Worker 40*e4a36f41SAndroid Build Coastguard Worker# Allow keystore binder access to serve the HwBinder service. 41*e4a36f41SAndroid Build Coastguard Workerallow wificond keystore_service:service_manager find; 42*e4a36f41SAndroid Build Coastguard Workerallow wificond keystore:keystore_key get; 43