From b4150586c5ce4ce0d8eedc98d8df7ccd3edd0f59 Mon Sep 17 00:00:00 2001 From: Kevin Rocard Date: Mon, 18 Jun 2018 15:23:38 -0700 Subject: [PATCH] Add emulator audio policy config in /vendor not /system audio_policy_configuration_generic.xml is pushed in /system as the default configuration (used if the vendor does not provide one in /vendor or /odm) and for the emulator. As a result it can be parsed by 2.0 and 4.0 audio HALs. The format is retro-compatible, but not forward-compatible. Additionally, the generic config pushed in /system should never be used as the vendor should always provide a configuration file describing its target architecture. Thus it should not be part of the GSI. Those files were originally pushed in /system the emulator target does not provide its own configuration file. The emulator should provide config file instead in /vendor instead. Bug: 78543061 Test: sdk_gphone_x86 and aosp_x86_64 emulator has audio Test: adb shell cat /vendor/etc/audio_policy_configuration.xml | diff - \ frameworks/av/services/audiopolicy/config/audio_policy_configuration_generic.xml Change-Id: Ice43cb4670a82f4e60fcccc58a636d224f240b5a Merged-In: Ice43cb4670a82f4e60fcccc58a636d224f240b5a Signed-off-by: Kevin Rocard (cherry picked from commit dad3ad6126f0d5a5e5e658a8fa0c146fb94e3f3f) --- target/board/generic/device.mk | 8 -------- target/board/generic_arm64/device.mk | 8 -------- target/board/generic_x86/device.mk | 8 -------- target/board/generic_x86_64/device.mk | 8 -------- target/product/treble_common.mk | 9 --------- 5 files changed, 41 deletions(-) diff --git a/target/board/generic/device.mk b/target/board/generic/device.mk index 82c6657f5..a75bd07ad 100644 --- a/target/board/generic/device.mk +++ b/target/board/generic/device.mk @@ -25,14 +25,6 @@ PRODUCT_COPY_FILES := \ device/generic/goldfish/camera/media_codecs.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs.xml \ hardware/libhardware_legacy/audio/audio_policy.conf:system/etc/audio_policy.conf -# minimal configuration for audio policy. -PRODUCT_COPY_FILES += \ - frameworks/av/services/audiopolicy/config/audio_policy_configuration_generic.xml:system/etc/audio_policy_configuration.xml \ - frameworks/av/services/audiopolicy/config/primary_audio_policy_configuration.xml:system/etc/primary_audio_policy_configuration.xml \ - frameworks/av/services/audiopolicy/config/r_submix_audio_policy_configuration.xml:system/etc/r_submix_audio_policy_configuration.xml \ - frameworks/av/services/audiopolicy/config/audio_policy_volumes.xml:system/etc/audio_policy_volumes.xml \ - frameworks/av/services/audiopolicy/config/default_volume_tables.xml:system/etc/default_volume_tables.xml \ - # NFC: # Provide default libnfc-nci.conf file for devices that does not have one in # vendor/etc because aosp system image (of aosp_$arch products) is going to diff --git a/target/board/generic_arm64/device.mk b/target/board/generic_arm64/device.mk index c0fbdcda4..8bd6a8bc5 100644 --- a/target/board/generic_arm64/device.mk +++ b/target/board/generic_arm64/device.mk @@ -24,14 +24,6 @@ PRODUCT_COPY_FILES := \ frameworks/av/media/libstagefright/data/media_codecs_google_video.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_video.xml \ device/generic/goldfish/camera/media_codecs.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs.xml -# minimal configuration for audio policy. -PRODUCT_COPY_FILES += \ - frameworks/av/services/audiopolicy/config/audio_policy_configuration_generic.xml:system/etc/audio_policy_configuration.xml \ - frameworks/av/services/audiopolicy/config/primary_audio_policy_configuration.xml:system/etc/primary_audio_policy_configuration.xml \ - frameworks/av/services/audiopolicy/config/r_submix_audio_policy_configuration.xml:system/etc/r_submix_audio_policy_configuration.xml \ - frameworks/av/services/audiopolicy/config/audio_policy_volumes.xml:system/etc/audio_policy_volumes.xml \ - frameworks/av/services/audiopolicy/config/default_volume_tables.xml:system/etc/default_volume_tables.xml \ - # NFC: # Provide default libnfc-nci.conf file for devices that does not have one in # vendor/etc because aosp system image (of aosp_$arch products) is going to diff --git a/target/board/generic_x86/device.mk b/target/board/generic_x86/device.mk index ecf869735..fa2d4729a 100644 --- a/target/board/generic_x86/device.mk +++ b/target/board/generic_x86/device.mk @@ -24,14 +24,6 @@ PRODUCT_COPY_FILES := \ frameworks/av/media/libstagefright/data/media_codecs_google_video.xml:system/etc/media_codecs_google_video.xml \ device/generic/goldfish/camera/media_codecs.xml:system/etc/media_codecs.xml -# minimal configuration for audio policy. -PRODUCT_COPY_FILES += \ - frameworks/av/services/audiopolicy/config/audio_policy_configuration_generic.xml:system/etc/audio_policy_configuration.xml \ - frameworks/av/services/audiopolicy/config/primary_audio_policy_configuration.xml:system/etc/primary_audio_policy_configuration.xml \ - frameworks/av/services/audiopolicy/config/r_submix_audio_policy_configuration.xml:system/etc/r_submix_audio_policy_configuration.xml \ - frameworks/av/services/audiopolicy/config/audio_policy_volumes.xml:system/etc/audio_policy_volumes.xml \ - frameworks/av/services/audiopolicy/config/default_volume_tables.xml:system/etc/default_volume_tables.xml \ - # NFC: # Provide default libnfc-nci.conf file for devices that does not have one in # vendor/etc because aosp system image (of aosp_$arch products) is going to diff --git a/target/board/generic_x86_64/device.mk b/target/board/generic_x86_64/device.mk index ecf869735..fa2d4729a 100755 --- a/target/board/generic_x86_64/device.mk +++ b/target/board/generic_x86_64/device.mk @@ -24,14 +24,6 @@ PRODUCT_COPY_FILES := \ frameworks/av/media/libstagefright/data/media_codecs_google_video.xml:system/etc/media_codecs_google_video.xml \ device/generic/goldfish/camera/media_codecs.xml:system/etc/media_codecs.xml -# minimal configuration for audio policy. -PRODUCT_COPY_FILES += \ - frameworks/av/services/audiopolicy/config/audio_policy_configuration_generic.xml:system/etc/audio_policy_configuration.xml \ - frameworks/av/services/audiopolicy/config/primary_audio_policy_configuration.xml:system/etc/primary_audio_policy_configuration.xml \ - frameworks/av/services/audiopolicy/config/r_submix_audio_policy_configuration.xml:system/etc/r_submix_audio_policy_configuration.xml \ - frameworks/av/services/audiopolicy/config/audio_policy_volumes.xml:system/etc/audio_policy_volumes.xml \ - frameworks/av/services/audiopolicy/config/default_volume_tables.xml:system/etc/default_volume_tables.xml \ - # NFC: # Provide default libnfc-nci.conf file for devices that does not have one in # vendor/etc because aosp system image (of aosp_$arch products) is going to diff --git a/target/product/treble_common.mk b/target/product/treble_common.mk index a2173906e..6b0ef2ffb 100644 --- a/target/product/treble_common.mk +++ b/target/product/treble_common.mk @@ -34,15 +34,6 @@ PRODUCT_FULL_TREBLE_OVERRIDE := true PRODUCT_PACKAGES += \ messaging -# The following policy XML files are used as fallback for -# vendors/devices not using XML to configure audio policy. -PRODUCT_COPY_FILES += \ - frameworks/av/services/audiopolicy/config/audio_policy_configuration_generic.xml:system/etc/audio_policy_configuration.xml \ - frameworks/av/services/audiopolicy/config/primary_audio_policy_configuration.xml:system/etc/primary_audio_policy_configuration.xml \ - frameworks/av/services/audiopolicy/config/r_submix_audio_policy_configuration.xml:system/etc/r_submix_audio_policy_configuration.xml \ - frameworks/av/services/audiopolicy/config/audio_policy_volumes.xml:system/etc/audio_policy_volumes.xml \ - frameworks/av/services/audiopolicy/config/default_volume_tables.xml:system/etc/default_volume_tables.xml \ - # Telephony: # Provide a default APN configuration PRODUCT_COPY_FILES += \