Skip to content

Commit 65990a1

Browse files
fukiamePeterCxy
authored andcommitted
gd: hci: Ignore unexpected status events
For some reason, on some old devices, the controller will report a remote to support SNIFF_SUBRATING even when it does not. Just ignore the error here (the status event comes from the failure response). patches: F DEBUG : pid: 3493, tid: 3527, name: bt_stack_manage >>> com.android.bluetooth <<< F DEBUG : Abort message: 'assertion 'command_queue_.front().waiting_for_status_ == is_status' failed - 0x200d (LE_CREATE_CONNECTION) was not expecting complete event' Co-authored-by: Peter Cai <[email protected]> Signed-off-by: fukiame <[email protected]> Signed-off-by: Wahid Khan <[email protected]>
1 parent fe35e11 commit 65990a1

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

system/gd/hci/hci_layer.cc

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -218,14 +218,13 @@ struct HciLayer::impl {
218218
command_queue_.front().GetCallback<CommandCompleteView>()->Invoke(
219219
std::move(command_complete_view));
220220
} else {
221-
ASSERT_LOG(
222-
command_queue_.front().waiting_for_status_ == is_status,
223-
"0x%02hx (%s) was not expecting %s event",
224-
op_code,
225-
OpCodeText(op_code).c_str(),
226-
logging_id.c_str());
227-
228-
command_queue_.front().GetCallback<TResponse>()->Invoke(std::move(response_view));
221+
if (command_queue_.front().waiting_for_status_ == is_status) {
222+
command_queue_.front().GetCallback<TResponse>()->Invoke(std::move(response_view));
223+
} else {
224+
CommandCompleteView command_complete_view = CommandCompleteView::Create(
225+
EventView::Create(PacketView<kLittleEndian>(std::make_shared<std::vector<uint8_t>>(std::vector<uint8_t>()))));
226+
command_queue_.front().GetCallback<CommandCompleteView>()->Invoke(std::move(command_complete_view));
227+
}
229228
}
230229

231230
#ifdef TARGET_FLOSS

0 commit comments

Comments
 (0)