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

Commit 2b295f3f authored by Cheney Ni's avatar Cheney Ni Committed by Gerrit Code Review
Browse files

Merge "BluetoothAudioHAL: Don't fetch the provider without HAL version"

parents be74cf8d 971756a5
Loading
Loading
Loading
Loading
+13 −5
Original line number Diff line number Diff line
@@ -418,15 +418,18 @@ BluetoothAudioSinkClientInterface::BluetoothAudioSinkClientInterface(
                                        this, message_loop),
                                    sink},
      sink_(sink) {
  if (HalVersionManager::GetHalVersion() ==
      BluetoothAudioHalVersion::VERSION_UNAVAILABLE) {
    return;
  }

  if ((HalVersionManager::GetHalVersion() ==
       BluetoothAudioHalVersion::VERSION_2_1) &&
      (sink_->GetSessionType_2_1() != SessionType_2_1::UNKNOWN)) {
    FetchAudioProvider_2_1();

    return;
  }

  if (sink_->GetSessionType() != SessionType::UNKNOWN) FetchAudioProvider();
  FetchAudioProvider();
}

BluetoothAudioSinkClientInterface::~BluetoothAudioSinkClientInterface() {
@@ -453,13 +456,18 @@ BluetoothAudioSourceClientInterface::BluetoothAudioSourceClientInterface(
                                        this, message_loop),
                                    source},
      source_(source) {
  if (HalVersionManager::GetHalVersion() ==
      BluetoothAudioHalVersion::VERSION_UNAVAILABLE) {
    return;
  }

  if ((HalVersionManager::GetHalVersion() ==
       BluetoothAudioHalVersion::VERSION_2_1) &&
      (source_->GetSessionType_2_1() != SessionType_2_1::UNKNOWN)) {
    FetchAudioProvider_2_1();
    return;
  }

  if (source_->GetSessionType() != SessionType::UNKNOWN) FetchAudioProvider();
  FetchAudioProvider();
}

BluetoothAudioSourceClientInterface::~BluetoothAudioSourceClientInterface() {