Jeff Vander Stoep | 27ae545 | 2016-10-25 12:42:39 -0700 | [diff] [blame^] | 1 | # hal_audio - audio services daemon |
| 2 | type hal_audio, domain; |
| 3 | type hal_audio_exec, exec_type, file_type; |
| 4 | |
| 5 | hwbinder_use(hal_audio) |
| 6 | binder_call(hal_audio, audioserver) |
| 7 | |
| 8 | allow hal_audio ion_device:chr_file r_file_perms; |
| 9 | |
| 10 | allow hal_audio system_file:dir { open read }; |
| 11 | |
| 12 | userdebug_or_eng(` |
| 13 | # used for pcm capture for debug. |
| 14 | allow hal_audio audiohal_data_file:dir create_dir_perms; |
| 15 | allow hal_audio audiohal_data_file:file create_file_perms; |
| 16 | ') |
| 17 | |
| 18 | r_dir_file(hal_audio, proc) |
| 19 | allow hal_audio audio_device:dir r_dir_perms; |
| 20 | allow hal_audio audio_device:chr_file rw_file_perms; |
| 21 | |
| 22 | # Needed on some devices for playing audio on paired BT device, |
| 23 | # but seems appropriate for all devices. |
| 24 | unix_socket_connect(hal_audio, bluetooth, bluetooth) |
| 25 | |
| 26 | ### |
| 27 | ### neverallow rules |
| 28 | ### |
| 29 | |
| 30 | # hal_audio should never execute any executable without |
| 31 | # a domain transition |
| 32 | neverallow hal_audio { file_type fs_type }:file execute_no_trans; |
| 33 | |
| 34 | # hal_audio should never need network access. |
| 35 | # Disallow network sockets. |
| 36 | neverallow hal_audio domain:{ tcp_socket udp_socket rawip_socket } *; |