Loading system/btif/src/btif_dm.cc +4 −0 Original line number Diff line number Diff line Loading @@ -74,6 +74,7 @@ #include "main/shim/helpers.h" #include "main/shim/le_advertising_manager.h" #include "main_thread.h" #include "metrics/bluetooth_event.h" #include "os/logging/log_adapter.h" #include "osi/include/properties.h" #include "osi/include/stack_power_telemetry.h" Loading Loading @@ -1590,6 +1591,7 @@ static void btif_on_service_discovery_results(RawAddress bd_addr, if (pairing_cb.sdp_attempts) { log::warn("SDP failed after bonding re-attempting for {}", bd_addr); pairing_cb.sdp_attempts++; bluetooth::metrics::LogSDPComplete(bd_addr, result); btif_dm_get_remote_services(bd_addr, BT_TRANSPORT_BR_EDR); } else { log::warn("SDP triggered by someone failed when bonding"); Loading @@ -1598,6 +1600,8 @@ static void btif_on_service_discovery_results(RawAddress bd_addr, } if (results_for_bonding_device) { // success for SDP bluetooth::metrics::LogSDPComplete(bd_addr, tBTA_STATUS::BTA_SUCCESS); log::info("SDP finished for {}:", bd_addr); pairing_cb.sdp_over_classic = btif_dm_pairing_cb_t::ServiceDiscoveryState::FINISHED; } Loading system/gd/metrics/bluetooth_event.cc +7 −0 Original line number Diff line number Diff line Loading @@ -154,5 +154,12 @@ void LogAuthenticationComplete(const RawAddress& raw_address, tHCI_STATUS hci_st MapHCIStatusToState(hci_status)); } void LogSDPComplete(const RawAddress& raw_address, tBTA_STATUS status) { hci::Address address = bluetooth::ToGdAddress(raw_address); bluetooth::os::LogMetricBluetoothEvent( address, EventType::SERVICE_DISCOVERY, status == tBTA_STATUS::BTA_SUCCESS ? State::SUCCESS : State::FAIL); } } // namespace metrics } // namespace bluetooth system/gd/metrics/bluetooth_event.h +3 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ #pragma once #include "bta/include/bta_sec_api.h" #include "hci/address.h" #include "hci/hci_packets.h" #include "stack/include/btm_status.h" Loading @@ -41,5 +42,7 @@ void LogUserConfirmationRequestResponse(const hci::Address& address, bool positi void LogAuthenticationComplete(const RawAddress& raw_address, tHCI_STATUS hci_status); void LogSDPComplete(const RawAddress& raw_address, tBTA_STATUS status); } // namespace metrics } // namespace bluetooth Loading
system/btif/src/btif_dm.cc +4 −0 Original line number Diff line number Diff line Loading @@ -74,6 +74,7 @@ #include "main/shim/helpers.h" #include "main/shim/le_advertising_manager.h" #include "main_thread.h" #include "metrics/bluetooth_event.h" #include "os/logging/log_adapter.h" #include "osi/include/properties.h" #include "osi/include/stack_power_telemetry.h" Loading Loading @@ -1590,6 +1591,7 @@ static void btif_on_service_discovery_results(RawAddress bd_addr, if (pairing_cb.sdp_attempts) { log::warn("SDP failed after bonding re-attempting for {}", bd_addr); pairing_cb.sdp_attempts++; bluetooth::metrics::LogSDPComplete(bd_addr, result); btif_dm_get_remote_services(bd_addr, BT_TRANSPORT_BR_EDR); } else { log::warn("SDP triggered by someone failed when bonding"); Loading @@ -1598,6 +1600,8 @@ static void btif_on_service_discovery_results(RawAddress bd_addr, } if (results_for_bonding_device) { // success for SDP bluetooth::metrics::LogSDPComplete(bd_addr, tBTA_STATUS::BTA_SUCCESS); log::info("SDP finished for {}:", bd_addr); pairing_cb.sdp_over_classic = btif_dm_pairing_cb_t::ServiceDiscoveryState::FINISHED; } Loading
system/gd/metrics/bluetooth_event.cc +7 −0 Original line number Diff line number Diff line Loading @@ -154,5 +154,12 @@ void LogAuthenticationComplete(const RawAddress& raw_address, tHCI_STATUS hci_st MapHCIStatusToState(hci_status)); } void LogSDPComplete(const RawAddress& raw_address, tBTA_STATUS status) { hci::Address address = bluetooth::ToGdAddress(raw_address); bluetooth::os::LogMetricBluetoothEvent( address, EventType::SERVICE_DISCOVERY, status == tBTA_STATUS::BTA_SUCCESS ? State::SUCCESS : State::FAIL); } } // namespace metrics } // namespace bluetooth
system/gd/metrics/bluetooth_event.h +3 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ #pragma once #include "bta/include/bta_sec_api.h" #include "hci/address.h" #include "hci/hci_packets.h" #include "stack/include/btm_status.h" Loading @@ -41,5 +42,7 @@ void LogUserConfirmationRequestResponse(const hci::Address& address, bool positi void LogAuthenticationComplete(const RawAddress& raw_address, tHCI_STATUS hci_status); void LogSDPComplete(const RawAddress& raw_address, tBTA_STATUS status); } // namespace metrics } // namespace bluetooth