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
This commit is contained in:
Jakub Tyszkowski
2024-01-08 13:55:01 +00:00
parent 06781c028a
commit deecabbd9c

View File

@@ -43,9 +43,6 @@ static bool isInvalidFileContent = false;
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()) {