Loading system/gd/metrics/bluetooth_event.cc +10 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ State MapErrorCodeToState(ErrorCode reason) { return State::TRANSACTION_RESPONSE_TIMEOUT; case ErrorCode::AUTHENTICATION_FAILURE: return State::AUTH_FAILURE; case ErrorCode::REMOTE_USER_TERMINATED_CONNECTION: case ErrorCode::REMOTE_DEVICE_TERMINATED_CONNECTION_LOW_RESOURCES: case ErrorCode::REMOTE_DEVICE_TERMINATED_CONNECTION_POWER_OFF: return State::REMOTE_USER_TERMINATED_CONNECTION; Loading Loading @@ -112,6 +113,15 @@ void LogRemoteNameRequestCompletion(const RawAddress& raw_address, tHCI_STATUS h MapHCIStatusToState(hci_status)); } void LogAclDisconnectionEvent(const hci::Address& address, ErrorCode reason, bool is_locally_initiated) { bluetooth::os::LogMetricBluetoothEvent(address, is_locally_initiated ? EventType::ACL_DISCONNECTION_INITIATOR : EventType::ACL_DISCONNECTION_RESPONDER, MapErrorCodeToState(reason)); } void LogAclAfterRemoteNameRequest(const RawAddress& raw_address, tBTM_STATUS status) { hci::Address address = bluetooth::ToGdAddress(raw_address); Loading system/gd/metrics/bluetooth_event.h +3 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,9 @@ void LogAclCompletionEvent(const hci::Address& address, hci::ErrorCode reason, void LogRemoteNameRequestCompletion(const RawAddress& raw_address, tHCI_STATUS hci_status); void LogAclDisconnectionEvent(const hci::Address& address, hci::ErrorCode reason, bool is_locally_initiated); void LogAclAfterRemoteNameRequest(const RawAddress& raw_address, tBTM_STATUS status); void LogUserConfirmationRequestResponse(const hci::Address& address, bool positive); Loading system/main/shim/acl.cc +2 −0 Original line number Diff line number Diff line Loading @@ -1397,6 +1397,8 @@ void shim::Acl::OnClassicLinkDisconnected(HciHandle handle, hci::ErrorCode reaso TeardownTime teardown_time = std::chrono::system_clock::now(); bluetooth::metrics::LogAclDisconnectionEvent(remote_address, reason, is_locally_initiated); pimpl_->handle_to_classic_connection_map_.erase(handle); TRY_POSTING_ON_MAIN(acl_interface_.connection.classic.on_disconnected, ToLegacyHciErrorCode(hci::ErrorCode::SUCCESS), handle, Loading Loading
system/gd/metrics/bluetooth_event.cc +10 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ State MapErrorCodeToState(ErrorCode reason) { return State::TRANSACTION_RESPONSE_TIMEOUT; case ErrorCode::AUTHENTICATION_FAILURE: return State::AUTH_FAILURE; case ErrorCode::REMOTE_USER_TERMINATED_CONNECTION: case ErrorCode::REMOTE_DEVICE_TERMINATED_CONNECTION_LOW_RESOURCES: case ErrorCode::REMOTE_DEVICE_TERMINATED_CONNECTION_POWER_OFF: return State::REMOTE_USER_TERMINATED_CONNECTION; Loading Loading @@ -112,6 +113,15 @@ void LogRemoteNameRequestCompletion(const RawAddress& raw_address, tHCI_STATUS h MapHCIStatusToState(hci_status)); } void LogAclDisconnectionEvent(const hci::Address& address, ErrorCode reason, bool is_locally_initiated) { bluetooth::os::LogMetricBluetoothEvent(address, is_locally_initiated ? EventType::ACL_DISCONNECTION_INITIATOR : EventType::ACL_DISCONNECTION_RESPONDER, MapErrorCodeToState(reason)); } void LogAclAfterRemoteNameRequest(const RawAddress& raw_address, tBTM_STATUS status) { hci::Address address = bluetooth::ToGdAddress(raw_address); Loading
system/gd/metrics/bluetooth_event.h +3 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,9 @@ void LogAclCompletionEvent(const hci::Address& address, hci::ErrorCode reason, void LogRemoteNameRequestCompletion(const RawAddress& raw_address, tHCI_STATUS hci_status); void LogAclDisconnectionEvent(const hci::Address& address, hci::ErrorCode reason, bool is_locally_initiated); void LogAclAfterRemoteNameRequest(const RawAddress& raw_address, tBTM_STATUS status); void LogUserConfirmationRequestResponse(const hci::Address& address, bool positive); Loading
system/main/shim/acl.cc +2 −0 Original line number Diff line number Diff line Loading @@ -1397,6 +1397,8 @@ void shim::Acl::OnClassicLinkDisconnected(HciHandle handle, hci::ErrorCode reaso TeardownTime teardown_time = std::chrono::system_clock::now(); bluetooth::metrics::LogAclDisconnectionEvent(remote_address, reason, is_locally_initiated); pimpl_->handle_to_classic_connection_map_.erase(handle); TRY_POSTING_ON_MAIN(acl_interface_.connection.classic.on_disconnected, ToLegacyHciErrorCode(hci::ErrorCode::SUCCESS), handle, Loading