From 892d1243c344d4c05c7b3f8403dec70facac26ee Mon Sep 17 00:00:00 2001 From: Cheney Ni Date: Tue, 4 Dec 2018 13:36:42 +0800 Subject: [PATCH] Support for Bluetooth Audio HAL V2 on Pixel 2 Remove primary flags from hearing aid also. Bug: 111519504 Bug: 124278829 Bug: 124014853 Test: manual with BluetoothAudioHAL enabled / disabled Change-Id: I57e521422ae37b359e08836429a4c8e1a99dd66b Merged-In: I57e521422ae37b359e08836429a4c8e1a99dd66b --- a2dp_in_audio_policy_configuration.xml | 22 ++ ...cy_configuration_bluetooth_hal_enabled.xml | 210 ++++++++++++++++++ bluetooth_audio_policy_configuration.xml | 44 ++++ device.mk | 7 +- manifest.xml | 9 + 5 files changed, 291 insertions(+), 1 deletion(-) create mode 100644 a2dp_in_audio_policy_configuration.xml create mode 100644 audio_policy_configuration_bluetooth_hal_enabled.xml create mode 100644 bluetooth_audio_policy_configuration.xml diff --git a/a2dp_in_audio_policy_configuration.xml b/a2dp_in_audio_policy_configuration.xml new file mode 100644 index 00000000..57bd4f81 --- /dev/null +++ b/a2dp_in_audio_policy_configuration.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + diff --git a/audio_policy_configuration_bluetooth_hal_enabled.xml b/audio_policy_configuration_bluetooth_hal_enabled.xml new file mode 100644 index 00000000..4ad3f6d2 --- /dev/null +++ b/audio_policy_configuration_bluetooth_hal_enabled.xml @@ -0,0 +1,210 @@ + + + + + + + + + + Speaker + Speaker Safe + Earpiece + Telephony Tx + Built-In Mic + Built-In Back Mic + Telephony Rx + + Speaker + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bluetooth_audio_policy_configuration.xml b/bluetooth_audio_policy_configuration.xml new file mode 100644 index 00000000..ce78eb00 --- /dev/null +++ b/bluetooth_audio_policy_configuration.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/device.mk b/device.mk index 1a60244d..213183f8 100755 --- a/device.mk +++ b/device.mk @@ -493,12 +493,14 @@ PRODUCT_PACKAGES += \ audio.usb.default \ audio.r_submix.default \ libaudio-resampler \ - audio.hearing_aid.default + audio.hearing_aid.default \ + audio.bluetooth.default PRODUCT_PACKAGES += \ android.hardware.audio@4.0-impl:32 \ android.hardware.audio.effect@4.0-impl:32 \ android.hardware.soundtrigger@2.1-impl:32 \ + android.hardware.bluetooth.audio@2.0-impl \ android.hardware.audio@2.0-service # stereo speakers: orientation changes swap L/R channels @@ -531,6 +533,9 @@ endif PRODUCT_COPY_FILES += \ $(LOCAL_PATH)/audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_configuration.xml \ + $(LOCAL_PATH)/audio_policy_configuration_bluetooth_hal_enabled.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_configuration_bluetooth_hal_enabled.xml \ + $(LOCAL_PATH)/a2dp_in_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/a2dp_in_audio_policy_configuration.xml \ + $(LOCAL_PATH)/bluetooth_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_audio_policy_configuration.xml \ frameworks/av/services/audiopolicy/config/a2dp_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/a2dp_audio_policy_configuration.xml \ frameworks/av/services/audiopolicy/config/usb_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/usb_audio_policy_configuration.xml \ frameworks/av/services/audiopolicy/config/r_submix_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/r_submix_audio_policy_configuration.xml \ diff --git a/manifest.xml b/manifest.xml index 75c41983..25800a72 100644 --- a/manifest.xml +++ b/manifest.xml @@ -35,6 +35,15 @@ default + + android.hardware.bluetooth.audio + hwbinder + 2.0 + + IBluetoothAudioProvidersFactory + default + + android.hardware.boot hwbinder