diff --git a/rootdir/etc/init.qcom.rc b/rootdir/etc/init.qcom.rc index 43a96592..02b0de1d 100755 --- a/rootdir/etc/init.qcom.rc +++ b/rootdir/etc/init.qcom.rc @@ -605,4 +605,5 @@ service vendor.audio-hal /vendor/bin/hw/android.hardware.audio.service capabilities BLOCK_SUSPEND ioprio rt 4 writepid /dev/cpuset/foreground/tasks /dev/stune/foreground/tasks + socket audio_hw_socket seqpacket 0666 system system onrestart restart audioserver diff --git a/sepolicy/vendor/file.te b/sepolicy/vendor/file.te index 16995b65..728e1787 100644 --- a/sepolicy/vendor/file.te +++ b/sepolicy/vendor/file.te @@ -13,6 +13,9 @@ type sysfs_fingerprint, sysfs_type, fs_type; # Kcal type kcal_dev, sysfs_type, fs_type; +# Sockets +type audio_socket, file_type; + # Touchscreen wake_gesture type proc_dt2w, fs_type, proc_type; type sysfs_tap_to_wake, sysfs_type, fs_type; diff --git a/sepolicy/vendor/file_contexts b/sepolicy/vendor/file_contexts index dff15527..3bc4809c 100644 --- a/sepolicy/vendor/file_contexts +++ b/sepolicy/vendor/file_contexts @@ -73,6 +73,9 @@ # Service HALs /(vendor|system/vendor)/bin/hw/android\.hardware\.authsecret@1\.0-service u:object_r:hal_authsecret_default_exec:s0 +# Sockets +/dev/socket/audio_hw_socket u:object_r:audio_socket:s0 + # Tap to Wake /sys/devices/soc/c177000.i2c/i2c-3/3-005d/enable_dt2w u:object_r:sysfs_tap_to_wake:s0 /sys/devices/soc/c177000.i2c/i2c-3/3-0038/enable_dt2w u:object_r:sysfs_tap_to_wake:s0 diff --git a/sepolicy/vendor/hal_audio_default.te b/sepolicy/vendor/hal_audio_default.te index 2be3f60b..5f4b570e 100644 --- a/sepolicy/vendor/hal_audio_default.te +++ b/sepolicy/vendor/hal_audio_default.te @@ -1,3 +1,4 @@ +allow hal_audio_default audio_socket:sock_file rw_file_perms; allow hal_audio_default diag_device:chr_file { read write }; allow hal_audio_default sysfs:dir r_dir_perms; allow hal_audio_default sysfs_info:file { open getattr read }; diff --git a/sepolicy/vendor/hal_sensors_default.te b/sepolicy/vendor/hal_sensors_default.te index a0d7974c..2e0e5156 100644 --- a/sepolicy/vendor/hal_sensors_default.te +++ b/sepolicy/vendor/hal_sensors_default.te @@ -2,3 +2,6 @@ allow hal_sensors_default diag_device:chr_file { read write }; allow hal_sensors_default sysfs:file { read open }; allow hal_sensors_default sysfs_info:file { read write }; set_prop(hal_sensors_default, camera_prop) + +allow hal_sensors_default audio_socket:sock_file rw_file_perms; +unix_socket_connect(hal_sensors_default, audio, hal_audio_default)