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

Commit 5e6b615e authored by Myles Watson's avatar Myles Watson
Browse files

HCI: Discard events that come after timeouts

Bug: 225259960
Test: command timeout followed by an event
Tag: #gd-refactor
Ignore-AOSP-First: Already in AOSP
Change-Id: Id34c55b388ffdd2fa000f02de3c62e5ee7108ff8
(cherry picked from commit 64d9774c)
parent efa9b4e0
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -176,6 +176,10 @@ struct HciLayer::impl {

    ASSERT_LOG(!command_queue_.empty(), "Unexpected %s event with OpCode 0x%02hx (%s)", logging_id.c_str(), op_code,
               OpCodeText(op_code).c_str());
    if (waiting_command_ == OpCode::CONTROLLER_DEBUG_INFO && op_code != OpCode::CONTROLLER_DEBUG_INFO) {
      LOG_ERROR("Discarding event that came after timeout 0x%02hx (%s)", op_code, OpCodeText(op_code).c_str());
      return;
    }
    ASSERT_LOG(waiting_command_ == op_code, "Waiting for 0x%02hx (%s), got 0x%02hx (%s)", waiting_command_,
               OpCodeText(waiting_command_).c_str(), op_code, OpCodeText(op_code).c_str());