Parse audio config codec capability for LE devices

 1. Rename function getHwOffloadEncodingFormatsSupportedForA2DP to
    getHwOffloadFormatsSupportedForBluetoothMedia
 2. Add one parameter for function
    getHwOffloadFormatsSupportedForBluetoothMedia to get the
    supported codec for A2DP encode/decode or LE audio encode/decode
 3. Add function getAudioDeviceOutAllBleSet() to get the audio device
    set for BLE

Tag: #feature
Bug: 203535499
Bug: 150670922
Test: atest BluetoothInstrumentationTests
Change-Id: I9de90c7f61db1f5de848ac66cfc8bd99d27d6cfb
Merged-In: I9de90c7f61db1f5de848ac66cfc8bd99d27d6cfb
diff --git a/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp b/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
index 77223b6..62dbc8d 100644
--- a/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
+++ b/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
@@ -1877,8 +1877,8 @@
     return Status::ok();
 }
 
-Status AudioPolicyService::getHwOffloadEncodingFormatsSupportedForA2DP(
-        std::vector<media::audio::common::AudioFormat>* _aidl_return) {
+Status AudioPolicyService::getHwOffloadFormatsSupportedForBluetoothMedia(
+        int32_t deviceAidl, std::vector<media::audio::common::AudioFormat>* _aidl_return) {
     std::vector<audio_format_t> formats;
 
     if (mAudioPolicyManager == NULL) {
@@ -1886,8 +1886,10 @@
     }
     Mutex::Autolock _l(mLock);
     AutoCallerClear acc;
+    audio_devices_t device = VALUE_OR_RETURN_BINDER_STATUS(
+            aidl2legacy_int32_t_audio_devices_t(deviceAidl));
     RETURN_IF_BINDER_ERROR(binderStatusFromStatusT(
-            mAudioPolicyManager->getHwOffloadEncodingFormatsSupportedForA2DP(&formats)));
+            mAudioPolicyManager->getHwOffloadFormatsSupportedForBluetoothMedia(device, &formats)));
     *_aidl_return = VALUE_OR_RETURN_BINDER_STATUS(
             convertContainer<std::vector<media::audio::common::AudioFormat>>(
                     formats,