Skip to content

Commit

Permalink
gd: hci: Ignore unexpected status events
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
2 people authored and Wahid7852 committed Jul 3, 2024
1 parent fe35e11 commit 65990a1
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions system/gd/hci/hci_layer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -218,14 +218,13 @@ struct HciLayer::impl {
command_queue_.front().GetCallback<CommandCompleteView>()->Invoke(
std::move(command_complete_view));
} else {
ASSERT_LOG(
command_queue_.front().waiting_for_status_ == is_status,
"0x%02hx (%s) was not expecting %s event",
op_code,
OpCodeText(op_code).c_str(),
logging_id.c_str());

command_queue_.front().GetCallback<TResponse>()->Invoke(std::move(response_view));
if (command_queue_.front().waiting_for_status_ == is_status) {
command_queue_.front().GetCallback<TResponse>()->Invoke(std::move(response_view));
} else {
CommandCompleteView command_complete_view = CommandCompleteView::Create(
EventView::Create(PacketView<kLittleEndian>(std::make_shared<std::vector<uint8_t>>(std::vector<uint8_t>()))));
command_queue_.front().GetCallback<CommandCompleteView>()->Invoke(std::move(command_complete_view));
}
}

#ifdef TARGET_FLOSS
Expand Down

0 comments on commit 65990a1

Please sign in to comment.