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

Commit bc737138 authored by Palash Ahuja's avatar Palash Ahuja Committed by Gerrit Code Review
Browse files

Merge "BluetoothMetrics: Log LE ACL Completion Event" into main

parents 8ccad851 ee51549c
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -260,5 +260,14 @@ void LogSDPComplete(const RawAddress& raw_address, tBTA_STATUS status) {
          status == tBTA_STATUS::BTA_SUCCESS ? State::SUCCESS : State::FAIL);
}

void LogLeAclCompletionEvent(const hci::Address& address, hci::ErrorCode reason,
                             bool is_locally_initiated) {
  bluetooth::os::LogMetricBluetoothEvent(address,
                                         is_locally_initiated
                                                 ? EventType::LE_ACL_CONNECTION_INITIATOR
                                                 : EventType::LE_ACL_CONNECTION_RESPONDER,
                                         MapErrorCodeToState(reason));
}

}  // namespace metrics
}  // namespace bluetooth
+3 −0
Original line number Diff line number Diff line
@@ -31,6 +31,9 @@ void LogIncomingAclStartEvent(const hci::Address& address);
void LogAclCompletionEvent(const hci::Address& address, hci::ErrorCode reason,
                           bool is_locally_initiated);

void LogLeAclCompletionEvent(const hci::Address& address, hci::ErrorCode reason,
                             bool is_locally_initiated);

void LogRemoteNameRequestCompletion(const RawAddress& raw_address, tHCI_STATUS hci_status);

void LogAclDisconnectionEvent(const hci::Address& address, hci::ErrorCode reason,
+4 −0
Original line number Diff line number Diff line
@@ -1624,6 +1624,9 @@ void shim::Acl::OnLeConnectSuccess(hci::AddressWithType address_with_type,

  log::debug("Connection successful le remote:{} handle:{} initiator:{}", address_with_type, handle,
             (locally_initiated) ? "local" : "remote");
  bluetooth::metrics::LogLeAclCompletionEvent(address_with_type.GetAddress(),
                                              hci::ErrorCode::SUCCESS, locally_initiated);

  BTM_LogHistory(kBtmLogTag, ToLegacyAddressWithType(address_with_type), "Connection successful",
                 "Le");
}
@@ -1638,6 +1641,7 @@ void shim::Acl::OnLeConnectFail(hci::AddressWithType address_with_type, hci::Err
  TRY_POSTING_ON_MAIN(acl_interface_.connection.le.on_failed, legacy_address_with_type, handle,
                      enhanced, status);

  bluetooth::metrics::LogLeAclCompletionEvent(address_with_type.GetAddress(), reason, true);
  pimpl_->shadow_acceptlist_.Remove(address_with_type);
  log::warn("Connection failed le remote:{}", address_with_type);
  BTM_LogHistory(kBtmLogTag, ToLegacyAddressWithType(address_with_type), "Connection failed",