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

Commit a15f4f14 authored by Henri Chataing's avatar Henri Chataing
Browse files

Gracefully handle IBluetoothAudioProviderFactory::openProvider failure

openProvider sometimes returns the ok() status but a null
IBluetoothAudioProvider instance. Gracefully handle this case
and treat it as a regular failure.

Bug: 372309179
Bug: 341856622
Test: m com.android.btservices
Flag: EXEMPT, minor bug fix
Change-Id: I90988e36a62336d64396e4fd14700ca48a11b80b
parent 39037b8d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -197,7 +197,7 @@ void BluetoothAudioClientInterface::FetchAudioProvider() {
              toString(transport_->GetSessionType()), capabilities_.size());

    aidl_retval = provider_factory->openProvider(transport_->GetSessionType(), &provider_);
    if (!aidl_retval.isOk()) {
    if (!aidl_retval.isOk() || provider_ == nullptr) {
      log::error("BluetoothAudioHal::openProvider failure: {}, retry number {}",
                 aidl_retval.getDescription(), retry_no + 1);
    } else {