Reland BluetoothAudio HAL: flip to be enabled by default on Pixel 1

Swap audio XML files, and supports following scenarios:
1) (default) audio_policy_configuration.xml
   Using BluetoothAudio HAL
2) audio_policy_configuration_bluetooth_legacy_hal.xml
   No BluetoothAudio HAL nor A2DP offload

Bug: 126304229
Test: Switch BluetoothAudio HAL manully
(cherry picked from commit 5cffd76cd258c366b17c5d766b56436247cb5f90)

Change-Id: Ia9af7020b428ad329653733d6a17903f6d217f66
(cherry picked from commit f0cc25ee66b79bd117513e0e7fe0fa41f1988eae)
(cherry picked from commit 2747ea81dd0db8fb49270b575caf1a2553ef2fab)
diff --git a/a2dp_in_audio_policy_configuration.xml b/a2dp_in_audio_policy_configuration.xml
deleted file mode 100644
index 57bd4f8..0000000
--- a/a2dp_in_audio_policy_configuration.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Bluetooth Input Audio HAL Audio Policy Configuration file -->
-<module name="a2dp" halVersion="2.0">
-    <mixPorts>
-        <mixPort name="a2dp input" role="sink">
-            <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
-                     samplingRates="44100,48000"
-                     channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO"/>
-        </mixPort>
-    </mixPorts>
-    <devicePorts>
-        <devicePort tagName="BT A2DP In" type="AUDIO_DEVICE_IN_BLUETOOTH_A2DP" role="source">
-            <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
-                     samplingRates="44100,48000"
-                     channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO"/>
-        </devicePort>
-    </devicePorts>
-    <routes>
-        <route type="mix" sink="a2dp input"
-               sources="BT A2DP In"/>
-    </routes>
-</module>
diff --git a/audio_policy_configuration.xml b/audio_policy_configuration.xml
index 7766036..73e35f4 100644
--- a/audio_policy_configuration.xml
+++ b/audio_policy_configuration.xml
@@ -155,8 +155,8 @@
 
         </module>
 
-        <!-- A2dp Audio HAL -->
-        <xi:include href="a2dp_audio_policy_configuration.xml"/>
+        <!-- A2DP Input Audio HAL -->
+        <xi:include href="a2dp_in_audio_policy_configuration.xml"/>
 
         <!-- Usb Audio HAL -->
         <xi:include href="usb_audio_policy_configuration.xml"/>
@@ -164,8 +164,8 @@
         <!-- Remote Submix Audio HAL -->
         <xi:include href="r_submix_audio_policy_configuration.xml"/>
 
-        <!-- Hearing aid Audio HAL -->
-        <xi:include href="hearing_aid_audio_policy_configuration.xml"/>
+        <!-- Bluetooth Audio HAL -->
+        <xi:include href="bluetooth_audio_policy_configuration.xml"/>
 
     </modules>
 
diff --git a/audio_policy_configuration_bluetooth_hal_enabled.xml b/audio_policy_configuration_bluetooth_legacy_hal.xml
similarity index 97%
rename from audio_policy_configuration_bluetooth_hal_enabled.xml
rename to audio_policy_configuration_bluetooth_legacy_hal.xml
index 73e35f4..7766036 100644
--- a/audio_policy_configuration_bluetooth_hal_enabled.xml
+++ b/audio_policy_configuration_bluetooth_legacy_hal.xml
@@ -155,8 +155,8 @@
 
         </module>
 
-        <!-- A2DP Input Audio HAL -->
-        <xi:include href="a2dp_in_audio_policy_configuration.xml"/>
+        <!-- A2dp Audio HAL -->
+        <xi:include href="a2dp_audio_policy_configuration.xml"/>
 
         <!-- Usb Audio HAL -->
         <xi:include href="usb_audio_policy_configuration.xml"/>
@@ -164,8 +164,8 @@
         <!-- Remote Submix Audio HAL -->
         <xi:include href="r_submix_audio_policy_configuration.xml"/>
 
-        <!-- Bluetooth Audio HAL -->
-        <xi:include href="bluetooth_audio_policy_configuration.xml"/>
+        <!-- Hearing aid Audio HAL -->
+        <xi:include href="hearing_aid_audio_policy_configuration.xml"/>
 
     </modules>
 
diff --git a/bluetooth_audio_policy_configuration.xml b/bluetooth_audio_policy_configuration.xml
deleted file mode 100644
index ce78eb0..0000000
--- a/bluetooth_audio_policy_configuration.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Bluetooth Audio HAL Audio Policy Configuration file -->
-<module name="bluetooth" halVersion="2.0">
-    <mixPorts>
-        <!-- A2DP Audio Ports -->
-        <mixPort name="a2dp output" role="source"/>
-        <!-- Hearing AIDs Audio Ports -->
-        <mixPort name="hearing aid output" role="source">
-            <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
-                     samplingRates="24000,16000"
-                     channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
-        </mixPort>
-    </mixPorts>
-    <devicePorts>
-        <!-- A2DP Audio Ports -->
-        <devicePort tagName="BT A2DP Out" type="AUDIO_DEVICE_OUT_BLUETOOTH_A2DP" role="sink">
-            <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
-                     samplingRates="44100,48000,88200,96000"
-                     channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
-        </devicePort>
-        <devicePort tagName="BT A2DP Headphones" type="AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES" role="sink">
-            <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
-                     samplingRates="44100,48000,88200,96000"
-                     channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
-        </devicePort>
-        <devicePort tagName="BT A2DP Speaker" type="AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER" role="sink">
-            <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
-                     samplingRates="44100,48000,88200,96000"
-                     channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
-        </devicePort>
-        <!-- Hearing AIDs Audio Ports -->
-        <devicePort tagName="BT Hearing Aid Out" type="AUDIO_DEVICE_OUT_HEARING_AID" role="sink"/>
-    </devicePorts>
-    <routes>
-        <route type="mix" sink="BT A2DP Out"
-               sources="a2dp output"/>
-        <route type="mix" sink="BT A2DP Headphones"
-               sources="a2dp output"/>
-        <route type="mix" sink="BT A2DP Speaker"
-               sources="a2dp output"/>
-        <route type="mix" sink="BT Hearing Aid Out"
-               sources="hearing aid output"/>
-    </routes>
-</module>
diff --git a/device-common.mk b/device-common.mk
index 97fa319..079bd13 100644
--- a/device-common.mk
+++ b/device-common.mk
@@ -110,11 +110,11 @@
     device/google/marlin/sound_trigger_platform_info.xml:$(TARGET_COPY_OUT_VENDOR)/etc/sound_trigger_platform_info.xml \
     device/google/marlin/audio_platform_info_tasha_t50.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_platform_info_tasha_t50.xml \
     device/google/marlin/audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_configuration.xml \
+    device/google/marlin/audio_policy_configuration_bluetooth_legacy_hal.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_configuration_bluetooth_legacy_hal.xml \
     device/google/marlin/audio_policy_volumes_drc.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_volumes_drc.xml \
-    device/google/marlin/audio_policy_configuration_bluetooth_hal_enabled.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_configuration_bluetooth_hal_enabled.xml \
-    device/google/marlin/a2dp_in_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/a2dp_in_audio_policy_configuration.xml \
-    device/google/marlin/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/a2dp_in_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/a2dp_in_audio_policy_configuration.xml \
+    frameworks/av/services/audiopolicy/config/bluetooth_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_audio_policy_configuration.xml \
     frameworks/av/services/audiopolicy/config/hearing_aid_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/hearing_aid_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 \
     frameworks/av/services/audiopolicy/config/usb_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/usb_audio_policy_configuration.xml \