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

Commit 4ff618e6 authored by Myles Watson's avatar Myles Watson
Browse files

RootCanal: Disallow configuring ongoing scans

Bug: 181371297
Test: cert/run LeAclManagerTest
Tag: #gd-refactor
Change-Id: I32c5931e69b7ab64e4d2c2f9558efa69ea9c34fb
parent 74c018f3
Loading
Loading
Loading
Loading
+14 −10
Original line number Diff line number Diff line
@@ -1933,6 +1933,8 @@ void DualModeController::LeSetExtendedScanParameters(CommandView command) {
  ASSERT(command_view.GetScanningPhys() == 1);
  ASSERT(parameters.size() == 1);

  auto status = ErrorCode::SUCCESS;
  if (link_layer_controller_.GetLeScanEnable() == OpCode::NONE) {
    link_layer_controller_.SetLeScanType(
        static_cast<uint8_t>(parameters[0].le_scan_type_));
    link_layer_controller_.SetLeScanInterval(parameters[0].le_scan_interval_);
@@ -1940,10 +1942,12 @@ void DualModeController::LeSetExtendedScanParameters(CommandView command) {
    link_layer_controller_.SetLeAddressType(command_view.GetOwnAddressType());
    link_layer_controller_.SetLeScanFilterPolicy(
        static_cast<uint8_t>(command_view.GetScanningFilterPolicy()));
  auto packet =
  } else {
    status = ErrorCode::COMMAND_DISALLOWED;
  }
  send_event_(
      bluetooth::hci::LeSetExtendedScanParametersCompleteBuilder::Create(
          kNumCommandPackets, ErrorCode::SUCCESS);
  send_event_(std::move(packet));
          kNumCommandPackets, status));
}

void DualModeController::LeSetExtendedScanEnable(CommandView command) {
+2 −0
Original line number Diff line number Diff line
@@ -237,6 +237,8 @@ class LinkLayerController {
      bluetooth::hci::Enable enable,
      const std::vector<bluetooth::hci::EnabledSet>& enabled_sets);

  bluetooth::hci::OpCode GetLeScanEnable() { return le_scan_enable_; }

  void SetLeScanEnable(bluetooth::hci::OpCode enabling_opcode) {
    le_scan_enable_ = enabling_opcode;
  }