diff --git a/base.mk b/base.mk index 96980b3..c1415aa 100644 --- a/base.mk +++ b/base.mk @@ -33,6 +33,9 @@ PRODUCT_COPY_FILES += \ device/phh/treble/ld.config.26.txt:system/etc/ld.config.26.txt \ device/phh/treble/ld.config.27.txt:system/etc/ld.config.27.txt \ +#USB Audio +PRODUCT_COPY_FILES += \ + frameworks/av/services/audiopolicy/config/usb_audio_policy_configuration.xml:system/etc/usb_audio_policy_configuration.xml # NFC: # Provide default libnfc-nci.conf file for devices that does not have one in diff --git a/sepolicy/file_contexts b/sepolicy/file_contexts index 10bc0ce..f80dc3a 100644 --- a/sepolicy/file_contexts +++ b/sepolicy/file_contexts @@ -1,2 +1,3 @@ /system/bin/phh-su u:object_r:phhsu_exec:s0 /system/bin/vndk-detect u:object_r:vndk_detect_exec:s0 +/system/etc/usb_audio_policy_configuration.xml u:object_r:vendor_configs_file:s0 diff --git a/sepolicy/vndk_detect.te b/sepolicy/vndk_detect.te index 01dec96..b530a35 100644 --- a/sepolicy/vndk_detect.te +++ b/sepolicy/vndk_detect.te @@ -11,6 +11,10 @@ allow vndk_detect toolbox_exec:file rx_file_perms; allow vndk_detect system_file:file rx_file_perms; #mount -o bind /system/bin/adbd /sbin/adbd -allow vndk_detect adbd_exec:file { getattr }; +allow vndk_detect adbd_exec:file { getattr read }; allow vndk_detect rootfs:file { mounton getattr }; allow vndk_detect self:capability { sys_admin }; + +#mount -o bind /system/etc/usb_audio_policy_configuration.xml /vendor/etc/usb_audio_policy_configuration.xml +allow init vendor_configs_file:file { getattr mounton }; + diff --git a/vndk.rc b/vndk.rc index f9dce09..064f0ae 100644 --- a/vndk.rc +++ b/vndk.rc @@ -1,3 +1,4 @@ on post-fs exec - root -- /system/bin/vndk-detect + mount none /system/etc/usb_audio_policy_configuration.xml /vendor/etc/usb_audio_policy_configuration.xml bind export LD_CONFIG_FILE /system/etc/ld.config.${persist.sys.vndk}.txt