Fix LeAudioCodecProvider failing offload setting file parsing
ParseFromLeAudioOffloadSettingFile() fails when `GetLeAudioCodecCapabilities()`
was already called in the past and `leAudioCodecCapabilities` vector is already
populated. That makes some of the VTS tests fail on
`IsOffloadOutputProviderInfoSupported()` and just return and PASS without
actually checking enything.
The doubtful checks check variables set at parsed content verification,
and should not prevent us from parsing the file again.
Bug: 319090769
Test: atest VtsHalBluetoothAudioTargetTest
Change-Id: Iab6235b5d265bb254ae6075b8c32d0eae0fc1829
diff --git a/bluetooth/audio/utils/aidl_session/BluetoothLeAudioCodecsProvider.cpp b/bluetooth/audio/utils/aidl_session/BluetoothLeAudioCodecsProvider.cpp
index 99dea84..473777c 100644
--- a/bluetooth/audio/utils/aidl_session/BluetoothLeAudioCodecsProvider.cpp
+++ b/bluetooth/audio/utils/aidl_session/BluetoothLeAudioCodecsProvider.cpp
@@ -43,9 +43,6 @@
std::optional<setting::LeAudioOffloadSetting>
BluetoothLeAudioCodecsProvider::ParseFromLeAudioOffloadSettingFile() {
- if (!leAudioCodecCapabilities.empty() || isInvalidFileContent) {
- return std::nullopt;
- }
auto le_audio_offload_setting =
setting::readLeAudioOffloadSetting(kLeAudioCodecCapabilitiesFile);
if (!le_audio_offload_setting.has_value()) {