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

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

Merge "bthal: Do not allow to initialize more than once" am: 23164ea0

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

Change-Id: Ie58c10ceec2164864233b3f0dd22c82b33373a42
parents 0cb860fa 23164ea0
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -281,6 +281,15 @@ Return<void> BluetoothHci::initialize_impl(
    ALOGE("cb == nullptr! -> Unable to call initializationComplete(ERR)");
    return Void();
  }
  if (hci_handle_ != nullptr) {
    ALOGE("hci_handle != nullptr! -> Double attempt to initialize the HAL");
    auto hidl_status =
        cb->initializationComplete(V1_0::Status::INITIALIZATION_ERROR);
    if (!hidl_status.isOk()) {
      ALOGE("VendorInterface -> Unable to call initializationComplete(ERR)");
    }
    return Void();
  }

  death_recipient_->setHasDied(false);
  cb->linkToDeath(death_recipient_, 0);