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

Commit cd7db1a4 authored by Cheney Ni's avatar Cheney Ni Committed by Automerger Merge Worker
Browse files

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

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1659939

Change-Id: I4f5f30d711e6dcb1df0693d9469836b62693a38c
parents 3f625c85 2b295f3f
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() {