Skip to content
Snippets Groups Projects
hal_audio.te 1.04 KiB
hwbinder_use(hal_audio)
binder_use(hal_audio)
binder_call(hal_audio, audioserver)
binder_call(hal_audio, system_server)

allow hal_audio ion_device:chr_file r_file_perms;

allow hal_audio system_file:dir { open read };

userdebug_or_eng(`
  # used for pcm capture for debug.
  allow hal_audio audiohal_data_file:dir create_dir_perms;
  allow hal_audio audiohal_data_file:file create_file_perms;
')

r_dir_file(hal_audio, proc)
allow hal_audio audio_device:dir r_dir_perms;
allow hal_audio audio_device:chr_file rw_file_perms;

allow hal_audio scheduling_policy_service:service_manager find;

# Needed on some devices for playing audio on paired BT device,
# but seems appropriate for all devices.
unix_socket_connect(hal_audio, bluetooth, bluetooth)

###
### neverallow rules
###

# hal_audio should never execute any executable without
# a domain transition
neverallow hal_audio { file_type fs_type }:file execute_no_trans;

# hal_audio should never need network access.
# Disallow network sockets.
neverallow hal_audio domain:{ tcp_socket udp_socket rawip_socket } *;