platform_system_sepolicy/public/hal_audio.te
Mikhail Naganov e91740a588 Allow hal_audio to set scheduling policy for its threads
Audio HAL server needs to set SCHED_FIFO scheduling policy
for its threads that communicate with FastMixer threads of
AudioFlinger that use the same scheduler.

Bug: 30222631
Change-Id: I405a69d097a6bfed455e3483365b27c4004e1063
2016-12-22 09:26:41 -08:00

36 lines
1 KiB
Text

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 } *;