Merge "BT: Ignore vendor debug packets in TearDown"

This commit is contained in:
TreeHugger Robot 2018-12-04 07:49:56 +00:00 committed by Android (Google) Code Review
commit c622013bce

View file

@ -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.