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

Commit 06867de3 authored by Henri Chataing's avatar Henri Chataing
Browse files

RootCanal: Send well formatted Apcf command complete event

The android stack panics if the LE Apcf Transport Discovery Service
command complete event is shortened, even with an error status code

Bug: 336513624
Test: m root-canal
Flag: EXEMPT, tool change
Change-Id: I3a0e7c954ba21d4f89b7dbd7e0b8fa7ae613e337
parent 35ddefcd
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -3108,11 +3108,17 @@ void DualModeController::LeApcf(CommandView command) {
      break;
    }
    case bluetooth::hci::ApcfOpcode::TRANSPORT_DISCOVERY_SERVICE: {
      auto subcommand_view =
          bluetooth::hci::LeApcfServiceDataView::Create(command_view);
      CHECK_PACKET_VIEW(subcommand_view);

      DEBUG(id_, "<< LE APCF Transport Discovery Service");
      DEBUG(id_, "   action={}",
            bluetooth::hci::ApcfActionText(subcommand_view.GetApcfAction()));

      send_event_(bluetooth::hci::LeApcfCompleteBuilder::Create(
      send_event_(bluetooth::hci::LeApcfTransportDiscoveryServiceCompleteBuilder::Create(
          kNumCommandPackets, ErrorCode::INVALID_HCI_COMMAND_PARAMETERS,
          command_view.GetApcfOpcode(), std::vector<uint8_t>{}));
          subcommand_view.GetApcfAction(), 0));
      break;
    }
    case bluetooth::hci::ApcfOpcode::AD_TYPE_FILTER: {
+11 −0
Original line number Diff line number Diff line
@@ -5995,6 +5995,17 @@ packet LeApcfAdTypeFilterComplete : LeApcfComplete (apcf_opcode = AD_TYPE_FILTER
  apcf_available_spaces : 8,
}

packet LeApcfTransportDiscoveryService : LeApcf (apcf_opcode = TRANSPORT_DISCOVERY_SERVICE) {
  apcf_action : ApcfAction,
  apcf_filter_index : 8,
  apcf_transport_discovery_data : 8[],
}

packet LeApcfTransportDiscoveryServiceComplete : LeApcfComplete (apcf_opcode = TRANSPORT_DISCOVERY_SERVICE) {
  apcf_action : ApcfAction,
  apcf_available_spaces : 8,
}

packet LeApcfReadExtendedFeatures : LeApcf (apcf_opcode = READ_EXTENDED_FEATURES) {
}