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

Commit 23164ea0 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

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

parents 45f35ebd 44bc06e1
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);