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

Commit 199e76a5 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "BTAudio HAL: Store factory provider handle" into tm-d1-dev am: 9ddc580f

parents 697022c6 9ddc580f
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -134,8 +134,12 @@ void BluetoothAudioClientInterface::FetchAudioProvider() {
  }
  CHECK(provider_ != nullptr);

  AIBinder_linkToDeath(provider_factory->asBinder().get(),
                       death_recipient_.get(), this);
  binder_status_t binder_status = AIBinder_linkToDeath(
      provider_factory->asBinder().get(), death_recipient_.get(), this);
  if (binder_status != STATUS_OK) {
    LOG(ERROR) << "Failed to linkToDeath " << static_cast<int>(binder_status);
  }
  provider_factory_ = std::move(provider_factory);

  LOG(INFO) << "IBluetoothAudioProvidersFactory::openProvider() returned "
            << provider_.get()
@@ -151,8 +155,8 @@ BluetoothAudioSinkClientInterface::BluetoothAudioSinkClientInterface(

BluetoothAudioSinkClientInterface::~BluetoothAudioSinkClientInterface() {
  if (provider_ != nullptr) {
    AIBinder_unlinkToDeath(provider_->asBinder().get(), death_recipient_.get(),
                           nullptr);
    AIBinder_unlinkToDeath(provider_factory_->asBinder().get(),
                           death_recipient_.get(), nullptr);
  }
}

@@ -165,8 +169,8 @@ BluetoothAudioSourceClientInterface::BluetoothAudioSourceClientInterface(

BluetoothAudioSourceClientInterface::~BluetoothAudioSourceClientInterface() {
  if (provider_ != nullptr) {
    AIBinder_unlinkToDeath(provider_->asBinder().get(), death_recipient_.get(),
                           nullptr);
    AIBinder_unlinkToDeath(provider_factory_->asBinder().get(),
                           death_recipient_.get(), nullptr);
  }
}

+2 −0
Original line number Diff line number Diff line
@@ -107,6 +107,8 @@ class BluetoothAudioClientInterface {

  std::shared_ptr<IBluetoothAudioProvider> provider_;

  std::shared_ptr<IBluetoothAudioProviderFactory> provider_factory_;

  bool session_started_;
  std::unique_ptr<DataMQ> data_mq_;