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

Commit 0803389a authored by Chen Chen's avatar Chen Chen Committed by Automerger Merge Worker
Browse files

hci_metrics_logging: check command before ASSERT(complete_view.IsValid()) am: eaf53693

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/bt/+/15685039

Change-Id: Ia57354655934bc0f7bb221f8d0514d8f2f1a7d6b
parents e996aac9 eaf53693
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -30,15 +30,23 @@ void log_hci_event(
  EventCode event_code = event_view.GetEventCode();
  switch (event_code) {
    case EventCode::COMMAND_COMPLETE: {
      CommandCompleteView complete_view = CommandCompleteView::Create(event_view);
      ASSERT(complete_view.IsValid());
      if (complete_view.GetCommandOpCode() == OpCode::NONE) {
        return;
      }
      ASSERT(command_view->IsValid());
      log_link_layer_connection_command_complete(event_view, command_view);
      log_classic_pairing_command_complete(event_view, command_view);
      break;
    }
    case EventCode::COMMAND_STATUS: {
      ASSERT(command_view->IsValid());
      CommandStatusView response_view = CommandStatusView::Create(event_view);
      ASSERT(response_view.IsValid());
      if (response_view.GetCommandOpCode() == OpCode::NONE) {
        return;
      }
      ASSERT(command_view->IsValid());
      log_link_layer_connection_command_status(command_view, response_view.GetStatus());
      log_classic_pairing_command_status(command_view, response_view.GetStatus());
      break;