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

Commit 49e1b3a0 authored by Henri Chataing's avatar Henri Chataing
Browse files

RootCanal: Harden the implementation for Set Event Filter

panic if the filter type is not CLEAR_ALL_FILTERS
The event filter have a direct impact on the connection
command and event flow, it is not safe to silently ignore
it.

Test: atest pts-bot
Bug: 286588829
Change-Id: I0e8dccfff018cbe42dd0ca99a89de3aa7849148a
parent 84daa526
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1702,6 +1702,10 @@ void DualModeController::SetEventFilter(CommandView command) {
  DEBUG(id_, "   filter_type={}",
        bluetooth::hci::FilterTypeText(command_view.GetFilterType()));

  if (command_view.GetFilterType() != bluetooth::hci::FilterType::CLEAR_ALL_FILTERS) {
    FATAL("unsupported event filter type");
  }

  send_event_(bluetooth::hci::SetEventFilterCompleteBuilder::Create(
      kNumCommandPackets, ErrorCode::SUCCESS));
}