From 59e9fa67a1ec68ade816a84d161dc4da93c7419f Mon Sep 17 00:00:00 2001 From: Liang Li Date: Fri, 7 Feb 2025 17:48:44 -0800 Subject: Add metrics logging for Bluetooth offload socket Bug: 399022276 Flag: EXEMPT, metrics update Test: m com.google.android.bt Test: Android Data Hub Atom Tester Change-Id: Ib5a4a0d6970287388851bcf5fdb71121e3092b76 --- system/test/mock/mock_main_shim_metrics_api.cc | 7 ++++--- system/test/mock/mock_main_shim_metrics_api.h | 14 ++++++++++---- 2 files changed, 14 insertions(+), 7 deletions(-) (limited to 'system/test') diff --git a/system/test/mock/mock_main_shim_metrics_api.cc b/system/test/mock/mock_main_shim_metrics_api.cc index 0a501c7e6c..e635979ed8 100644 --- a/system/test/mock/mock_main_shim_metrics_api.cc +++ b/system/test/mock/mock_main_shim_metrics_api.cc @@ -184,12 +184,13 @@ void bluetooth::shim::LogMetricSdpAttribute(const RawAddress& raw_address, uint1 void bluetooth::shim::LogMetricSocketConnectionState( const RawAddress& raw_address, int port, int type, android::bluetooth::SocketConnectionstateEnum connection_state, int64_t tx_bytes, - int64_t rx_bytes, int uid, int server_port, - android::bluetooth::SocketRoleEnum socket_role) { + int64_t rx_bytes, int uid, int server_port, android::bluetooth::SocketRoleEnum socket_role, + uint64_t connection_duration_ms, android::bluetooth::SocketErrorEnum error_code, + bool is_hardware_offload) { inc_func_call_count(__func__); test::mock::main_shim_metrics_api::LogMetricSocketConnectionState( raw_address, port, type, connection_state, tx_bytes, rx_bytes, uid, server_port, - socket_role); + socket_role, connection_duration_ms, error_code, is_hardware_offload); } void bluetooth::shim::LogMetricManufacturerInfo( const RawAddress& raw_address, android::bluetooth::AddressTypeEnum address_type, diff --git a/system/test/mock/mock_main_shim_metrics_api.h b/system/test/mock/mock_main_shim_metrics_api.h index 887090d743..4beaab72c0 100644 --- a/system/test/mock/mock_main_shim_metrics_api.h +++ b/system/test/mock/mock_main_shim_metrics_api.h @@ -274,17 +274,23 @@ struct LogMetricSocketConnectionState { std::function + android::bluetooth::SocketRoleEnum socket_role, + uint64_t connection_duration_ms, + android::bluetooth::SocketErrorEnum error_code, bool is_hardware_offload)> body{[](const RawAddress& /* raw_address */, int /* port */, int /* type */, android::bluetooth::SocketConnectionstateEnum /* connection_state */, int64_t /* tx_bytes */, int64_t /* rx_bytes */, int /* uid */, - int /* server_port */, android::bluetooth::SocketRoleEnum /* socket_role */) {}}; + int /* server_port */, android::bluetooth::SocketRoleEnum /* socket_role */, + uint64_t /* connection_duration_ms */, + android::bluetooth::SocketErrorEnum /* error_code */, + bool /* is_hardware_offload */) {}}; void operator()(const RawAddress& raw_address, int port, int type, android::bluetooth::SocketConnectionstateEnum connection_state, int64_t tx_bytes, int64_t rx_bytes, int uid, int server_port, - android::bluetooth::SocketRoleEnum socket_role) { + android::bluetooth::SocketRoleEnum socket_role, uint64_t connection_duration_ms, + android::bluetooth::SocketErrorEnum error_code, bool is_hardware_offload) { body(raw_address, port, type, connection_state, tx_bytes, rx_bytes, uid, server_port, - socket_role); + socket_role, connection_duration_ms, error_code, is_hardware_offload); } }; extern struct LogMetricSocketConnectionState LogMetricSocketConnectionState; -- cgit v1.2.3-59-g8ed1b