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

Commit b7d98cc3 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "BTAudio HAL: Store factory provider handle" am: 57c18f84

parents 3af7254b 57c18f84
Loading
Loading
Loading
Loading
+8 −4
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,7 +155,7 @@ BluetoothAudioSinkClientInterface::BluetoothAudioSinkClientInterface(

BluetoothAudioSinkClientInterface::~BluetoothAudioSinkClientInterface() {
  if (provider_ != nullptr) {
    AIBinder_unlinkToDeath(provider_->asBinder().get(), death_recipient_.get(),
    AIBinder_unlinkToDeath(provider_factory_->asBinder().get(), death_recipient_.get(),
                           nullptr);
  }
}
@@ -165,7 +169,7 @@ BluetoothAudioSourceClientInterface::BluetoothAudioSourceClientInterface(

BluetoothAudioSourceClientInterface::~BluetoothAudioSourceClientInterface() {
  if (provider_ != nullptr) {
    AIBinder_unlinkToDeath(provider_->asBinder().get(), death_recipient_.get(),
    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_;