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

Commit 735ff61a authored by weichinweng's avatar weichinweng Committed by Weichin Weng
Browse files

Use hci_root_inflamed_abort if received root inflamed packet

Sometimes, Since the hci_timeout_abort abort_timer triggered is faster
then the bluetooth HIDL service died, the bt_stack doesn't call
hci_root_inflamed_abort even if received root inflamed packet. Use
hci_root_inflamed_abort when HCI command timeout if it received the root
inflamed packet.

Bug: 182940721
Test: atest BluetoothInstrumentationTests
Tag: #feature
Change-Id: I877ac13e46ac12ef42fc149a7d4a16d932f014d2
parent 7898ae38
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -180,11 +180,7 @@ void iso_data_received(BT_HDR* packet) {

void hal_service_died() {
  if (abort_timer.IsScheduled()) {
    if (root_inflamed_vendor_error_code != 0 || root_inflamed_error_code != 0) {
      hci_root_inflamed_abort();
    } else {
    hci_timeout_abort();
    }
    return;
  }
  // The Bluetooth hal suddenly died and no root inflammation packet received.
@@ -470,6 +466,11 @@ static void fragmenter_transmit_finished(BT_HDR* packet,

// Abort.  The chip has had time to write any debugging information.
static void hci_timeout_abort(void) {
  if (root_inflamed_vendor_error_code != 0 || root_inflamed_error_code != 0) {
    hci_root_inflamed_abort();
    return;
  }

  LOG_ERROR("%s restarting the Bluetooth process.", __func__);
  hci_close_firmware_log_file(hci_firmware_log_fd);