Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit deecabbd authored by Jakub Tyszkowski's avatar Jakub Tyszkowski
Browse files

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
parent 06781c02
Loading
Loading
Loading
Loading
+0 −3
Original line number Original line Diff line number Diff line
@@ -43,9 +43,6 @@ static bool isInvalidFileContent = false;


std::optional<setting::LeAudioOffloadSetting>
std::optional<setting::LeAudioOffloadSetting>
BluetoothLeAudioCodecsProvider::ParseFromLeAudioOffloadSettingFile() {
BluetoothLeAudioCodecsProvider::ParseFromLeAudioOffloadSettingFile() {
  if (!leAudioCodecCapabilities.empty() || isInvalidFileContent) {
    return std::nullopt;
  }
  auto le_audio_offload_setting =
  auto le_audio_offload_setting =
      setting::readLeAudioOffloadSetting(kLeAudioCodecCapabilitiesFile);
      setting::readLeAudioOffloadSetting(kLeAudioCodecCapabilitiesFile);
  if (!le_audio_offload_setting.has_value()) {
  if (!le_audio_offload_setting.has_value()) {