7cda44f49f
This change associates all domains which are clients of Allocator HAL with hal_allocator_client and the, required for all HAL client domains, halclientdomain. This enables this commit to remove the now unnecessary hwallocator_use macro because its binder_call(..., hal_allocator_server) is covered by binder_call(hal_allocator_client, hal_allocator_server) added in this commit. Unfortunately apps, except isolated app, are clients of Allocator HAL as well. This makes it hard to use the hal_client_domain(..., hal_allocator) macro because it translates into "typeattribute" which currently does not support being provided with a set of types, such as { appdomain -isolated_app }. As a workaround, hopefully until typeattribute is improved, this commit expresses the necessary association operation in CIL. private/technical_debt.cil introduced by this commit is appended into the platform policy CIL file, thus ensuring that the hack has effect on the final monolithic policy. P. S. This change also removes Allocator HAL access from isolated_app. Isolated app shouldn't have access to this HAL anyway. Test: Google Play Music plays back radios Test: Google Camera records video with sound and that video is then successfully played back with sound Test: YouTube app plays back clips with sound Test: YouTube in Chrome plays back clips with sound Bug: 34170079 Change-Id: Id00bba6fde83e7cf04fb58bc1c353c2f66333f92
37 lines
1.2 KiB
Text
37 lines
1.2 KiB
Text
# HwBinder IPC from client to server, and callbacks
|
|
binder_call(hal_audio_client, hal_audio_server)
|
|
binder_call(hal_audio_server, hal_audio_client)
|
|
|
|
allow hal_audio ion_device:chr_file r_file_perms;
|
|
|
|
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;
|
|
|
|
# Needed to provide debug dump output via dumpsys' pipes.
|
|
allow hal_audio shell:fd use;
|
|
allow hal_audio shell:fifo_file write;
|
|
|
|
# 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
|
|
###
|
|
|
|
# Should never execute any executable without a domain transition
|
|
neverallow hal_audio { file_type fs_type }:file execute_no_trans;
|
|
|
|
# Should never need network access.
|
|
# Disallow network sockets.
|
|
neverallow hal_audio domain:{ tcp_socket udp_socket rawip_socket } *;
|
|
|
|
# Only audio HAL may directly access the audio hardware
|
|
neverallow { halserverdomain -hal_audio_server } audio_device:chr_file *;
|