polaris: Override vendor's usb_audio_policy_configuration

Android 8.1 added the support for new type of USB Audio devices
(USB_HEADSET, instead of old USB_DEVICE)
Some older USB devices got converted to this USB_HEADSET while still
using the old protocol.
There is no driver change needed, but the audio policy needs to be
changed.
Since vendors are simply using AOSP usb_audio_policy_configuration
Override it by ourself.

Change-Id: I5c43cd7c95f721914cf94f4dc20c992b4f6a24e9
This commit is contained in:
Pierre-Hugues Husson
2018-04-01 00:21:03 +02:00
committed by Bruno Martins
parent c29e46cef9
commit 9355330e38
4 changed files with 11 additions and 0 deletions

View File

@@ -28,6 +28,10 @@ PRODUCT_AAPT_PREF_CONFIG := xxhdpi
# Inherit from sdm845-common
$(call inherit-product, device/xiaomi/sdm845-common/sdm845.mk)
# Audio
PRODUCT_COPY_FILES += \
frameworks/av/services/audiopolicy/config/usb_audio_policy_configuration.xml:system/etc/usb_audio_policy_configuration.xml
# Device init scripts
PRODUCT_PACKAGES += \
init.target.rc

View File

@@ -1,2 +1,3 @@
on init
mount none /system/bin/time_daemon /vendor/bin/time_daemon bind
mount none /system/etc/usb_audio_policy_configuration.xml /vendor/etc/usb_audio_policy_configuration.xml bind

View File

@@ -1,2 +1,5 @@
# Audio
/system/etc/usb_audio_policy_configuration.xml u:object_r:vendor_configs_file:s0
# Time services
/system/bin/time_daemon u:object_r:time_daemon_exec:s0

View File

@@ -1,2 +1,5 @@
# Allow init to bind mount time_daemon
allow init time_daemon_exec:file mounton;
# Allow init to mount vendor configs
allow init vendor_configs_file:file mounton;