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

Commit 5ab36779 authored by Jack He's avatar Jack He
Browse files

BT: Ignore vendor debug packets in TearDown

Test: make, VtsHalBluetoothV1_0TargetTest
Change-Id: Id965b3783f4e599f5389166c5a98e6ee35cee15c
parent 0561e5c2
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -105,6 +105,9 @@ using ::android::hardware::bluetooth::V1_0::Status;
  (ACL_PACKET_BOUNDARY_FLAG_FIRST_AUTO_FLUSHABLE \
   << ACL_PACKET_BOUNDARY_FLAG_OFFSET)

// To be removed in VTS release builds
#define ACL_HANDLE_QCA_DEBUG_MESSAGE 0xedc

constexpr char kCallbackNameAclEventReceived[] = "aclDataReceived";
constexpr char kCallbackNameHciEventReceived[] = "hciEventReceived";
constexpr char kCallbackNameInitializationComplete[] = "initializationComplete";
@@ -318,6 +321,19 @@ void BluetoothHidlTest::handle_no_ops() {
      break;
    }
  }
  // To be removed in VTS release builds
  while (acl_queue.size() > 0) {
    hidl_vec<uint8_t> acl_packet = acl_queue.front();
    uint16_t connection_handle = acl_packet[1] & 0xF;
    connection_handle <<= 8;
    connection_handle |= acl_packet[0];
    bool packet_is_no_op = connection_handle == ACL_HANDLE_QCA_DEBUG_MESSAGE;
    if (packet_is_no_op) {
      acl_queue.pop();
    } else {
      break;
    }
  }
}

// Receive an event, discarding NO-OPs.