Template and schema of HFP provider info
Bug: 322280104
Test: make
Change-Id: Iac4f96db08b3b7fb2c5f0b080ba3e972e6020982
diff --git a/bluetooth/audio/utils/aidl_session/BluetoothAudioCodecs.cpp b/bluetooth/audio/utils/aidl_session/BluetoothAudioCodecs.cpp
index d37825a..c25b102 100644
--- a/bluetooth/audio/utils/aidl_session/BluetoothAudioCodecs.cpp
+++ b/bluetooth/audio/utils/aidl_session/BluetoothAudioCodecs.cpp
@@ -32,6 +32,7 @@
#include <aidl/android/hardware/bluetooth/audio/SbcChannelMode.h>
#include <android-base/logging.h>
+#include "BluetoothHfpCodecsProvider.h"
#include "BluetoothLeAudioAseConfigurationSettingProvider.h"
#include "BluetoothLeAudioCodecsProvider.h"
@@ -100,6 +101,7 @@
std::vector<LeAudioCodecCapabilitiesSetting> kDefaultOffloadLeAudioCapabilities;
std::unordered_map<SessionType, std::vector<CodecInfo>>
kDefaultOffloadLeAudioCodecInfoMap;
+std::vector<CodecInfo> kDefaultOffloadHfpCodecInfo;
template <class T>
bool BluetoothAudioCodecs::ContainedInVector(
@@ -439,6 +441,17 @@
return codec_info_map_iter->second;
}
+std::vector<CodecInfo> BluetoothAudioCodecs::GetHfpOffloadCodecInfo() {
+ if (kDefaultOffloadHfpCodecInfo.empty()) {
+ auto hfp_offload_setting =
+ BluetoothHfpCodecsProvider::ParseFromHfpOffloadSettingFile();
+ // Load file into list
+ kDefaultOffloadHfpCodecInfo =
+ BluetoothHfpCodecsProvider::GetHfpAudioCodecInfo(hfp_offload_setting);
+ }
+ return kDefaultOffloadHfpCodecInfo;
+}
+
std::vector<LeAudioAseConfigurationSetting>
BluetoothAudioCodecs::GetLeAudioAseConfigurationSettings() {
return AudioSetConfigurationProviderJson::