diff --git a/audio/audio_policy_configuration.xml b/audio/audio_policy_configuration.xml new file mode 100644 index 0000000..df52c49 --- /dev/null +++ b/audio/audio_policy_configuration.xml @@ -0,0 +1,432 @@ + + + + + + + + + + + + + + + + + Earpiece + Speaker + Telephony Tx + Built-In Mic + Built-In Back Mic + FM Tuner + Telephony Rx + + Speaker + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common.mk b/common.mk index 01c8c11..6537a74 100644 --- a/common.mk +++ b/common.mk @@ -53,6 +53,9 @@ PRODUCT_PACKAGES += \ PRODUCT_PACKAGES += \ audio.a2dp.default +PRODUCT_COPY_FILES += \ + $(LOCAL_PATH)/audio/audio_policy_configuration.xml:system/etc/audio_policy_configuration.xml + # Boot control PRODUCT_PACKAGES_DEBUG += \ bootctl diff --git a/rootdir/etc/init.qcom.rc b/rootdir/etc/init.qcom.rc index 92a247b..57e3bd9 100644 --- a/rootdir/etc/init.qcom.rc +++ b/rootdir/etc/init.qcom.rc @@ -1,4 +1,5 @@ on init + mount none /system/etc/audio_policy_configuration.xml /vendor/etc/audio/audio_policy_configuration.xml bind mount none /system/lib64/hw/power.qcom.so /vendor/lib64/hw/power.qcom.so bind mount none /system/lib/hw/power.qcom.so /vendor/lib/hw/power.qcom.so bind mount none /system/lib64/hw/hwcomposer.qcom.so /vendor/lib64/hw/hwcomposer.sdm845.so bind diff --git a/sepolicy/private/file_contexts b/sepolicy/private/file_contexts index 8364aa9..b35ea31 100644 --- a/sepolicy/private/file_contexts +++ b/sepolicy/private/file_contexts @@ -9,6 +9,9 @@ # Files in sysfs /sys/devices/platform/soc/soc:goodix_fp/proximity_state u:object_r:sysfs_fpc_proximity:s0 +# Audio +/system/etc/audio_policy_configuration.xml u:object_r:vendor_configs_file:s0 + # Lights /system/bin/hw/android\.hardware\.light@2\.0-service\.oneplus_sdm845 u:object_r:hal_light_sdm845_exec:s0 diff --git a/sepolicy/private/init.te b/sepolicy/private/init.te index b6e2555..463e759 100644 --- a/sepolicy/private/init.te +++ b/sepolicy/private/init.te @@ -1,5 +1,8 @@ # Allow init to mount wlan kernel module allow init vendor_file:file mounton; +# Allow init to mount vendor configs +allow init vendor_configs_file:file mounton; + # Allow init to chown/chmod on pseudo files in /sys allow init sysfs_type:file { open read setattr };