summaryrefslogtreecommitdiff
path: root/system/test
diff options
context:
space:
mode:
author Liang Li <lianglli@google.com> 2025-02-07 17:48:44 -0800
committer Liang Li <lianglli@google.com> 2025-03-10 11:26:52 -0700
commit59e9fa67a1ec68ade816a84d161dc4da93c7419f (patch)
tree38c6d37813783c039d95cace6afb25c61a323a4f /system/test
parentff22be65bf8163fd8749d1b57d8b47e3eaf807db (diff)
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
Diffstat (limited to 'system/test')
-rw-r--r--system/test/mock/mock_main_shim_metrics_api.cc7
-rw-r--r--system/test/mock/mock_main_shim_metrics_api.h14
2 files changed, 14 insertions, 7 deletions
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<void(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{[](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;