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

Commit da6a4b3e authored by Bao Do's avatar Bao Do
Browse files

Allow retry when calling getProviderCapabilities from Audio HAL.

This helps guard BT processes against audioserver restarts.

In some cases, BT Audio HAL will crash right after service is registered.
We allow retry to help prevent crash such cases.

Bug: 363527989
Test: mmm packages/modules/Bluetooth

Change-Id: Ife0315e4b38d64b11612159f09fb58d5732aaa10
parent 9c96b0a0
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -195,9 +195,9 @@ void BluetoothAudioClientInterface::FetchAudioProvider() {
    auto aidl_retval =
            provider_factory->getProviderCapabilities(transport_->GetSessionType(), &capabilities_);
    if (!aidl_retval.isOk()) {
      log::fatal("BluetoothAudioHal::getProviderCapabilities failure: {}",
                 aidl_retval.getDescription());
      return;
      log::error("BluetoothAudioHal::getProviderCapabilities failure: {}, retry number {}",
                 aidl_retval.getDescription(), retry_no + 1);
      continue;
    }
    if (capabilities_.empty()) {
      log::warn("SessionType={} Not supported by BluetoothAudioHal",
@@ -216,6 +216,7 @@ void BluetoothAudioClientInterface::FetchAudioProvider() {
      break;
    }
  }
  log::assert_that(provider_factory_ != nullptr, "assert failed: provider_factory_ != nullptr");
  log::assert_that(provider_ != nullptr, "assert failed: provider_ != nullptr");

  binder_status_t binder_status =