diff options
author | 2025-02-19 16:39:50 -0800 | |
---|---|---|
committer | 2025-02-19 16:39:50 -0800 | |
commit | e7e402ea4f4580bc2a116b22ebd93fa7ae4e2e31 (patch) | |
tree | 7facdf021c2d2c4cd681e176f4948d2644deef33 /system/test | |
parent | 03fb93e3c9e0d6af6bb0c43c3462616b886662e9 (diff) | |
parent | 6d0b56485b2ec6af89c9c14d00f524cdc51b4c38 (diff) |
Merge "BluetoothMetrics: Timeout failure for LE-ACL Connection" into main
Diffstat (limited to 'system/test')
-rw-r--r-- | system/test/mock/mock_main_shim_metrics_api.cc | 8 | ||||
-rw-r--r-- | system/test/mock/mock_main_shim_metrics_api.h | 16 | ||||
-rw-r--r-- | system/test/mock/mock_stack_metrics_logging.cc | 8 | ||||
-rw-r--r-- | system/test/mock/mock_stack_metrics_logging.h | 13 |
4 files changed, 45 insertions, 0 deletions
diff --git a/system/test/mock/mock_main_shim_metrics_api.cc b/system/test/mock/mock_main_shim_metrics_api.cc index 841cd759a9..ac64150797 100644 --- a/system/test/mock/mock_main_shim_metrics_api.cc +++ b/system/test/mock/mock_main_shim_metrics_api.cc @@ -58,6 +58,7 @@ struct LogMetricManufacturerInfo LogMetricManufacturerInfo; struct LogMetricLeConnectionStatus LogMetricLeConnectionStatus; struct LogMetricLeDeviceInAcceptList LogMetricLeDeviceInAcceptList; struct LogMetricLeConnectionLifecycle LogMetricLeConnectionLifecycle; +struct LogMetricLeConnectionCompletion LogMetricLeConnectionCompletion; } // namespace main_shim_metrics_api } // namespace mock @@ -207,4 +208,11 @@ void bluetooth::shim::LogMetricLeConnectionLifecycle(bluetooth::hci::Address add inc_func_call_count(__func__); test::mock::main_shim_metrics_api::LogMetricLeConnectionLifecycle(address, is_connect, is_direct); } +void bluetooth::shim::LogMetricLeConnectionCompletion(bluetooth::hci::Address address, + bluetooth::hci::ErrorCode reason, + bool is_locally_initiated) { + inc_func_call_count(__func__); + test::mock::main_shim_metrics_api::LogMetricLeConnectionCompletion(address, reason, + is_locally_initiated); +} // END mockcify generation diff --git a/system/test/mock/mock_main_shim_metrics_api.h b/system/test/mock/mock_main_shim_metrics_api.h index f5f177b5f4..6b8d8e5edf 100644 --- a/system/test/mock/mock_main_shim_metrics_api.h +++ b/system/test/mock/mock_main_shim_metrics_api.h @@ -351,6 +351,22 @@ struct LogMetricLeConnectionLifecycle { }; extern struct LogMetricLeConnectionLifecycle LogMetricLeConnectionLifecycle; +// Name: LogMetricLeConnectionCompletion +// Params: bluetooth::hci::Address, hci::ErrorCode reason, bool +// is_locally_initiated +// Returns: void +struct LogMetricLeConnectionCompletion { + std::function<void(bluetooth::hci::Address address, bluetooth::hci::ErrorCode reason, + bool is_locally_initiated)> + body{[](bluetooth::hci::Address /* address */, bluetooth::hci::ErrorCode /* reason */, + bool /* is_locally_initiated */) {}}; + void operator()(bluetooth::hci::Address address, bluetooth::hci::ErrorCode reason, + bool is_locally_initiated) { + body(address, reason, is_locally_initiated); + } +}; +extern struct LogMetricLeConnectionCompletion LogMetricLeConnectionCompletion; + } // namespace main_shim_metrics_api } // namespace mock } // namespace test diff --git a/system/test/mock/mock_stack_metrics_logging.cc b/system/test/mock/mock_stack_metrics_logging.cc index f2336668e1..c07d594280 100644 --- a/system/test/mock/mock_stack_metrics_logging.cc +++ b/system/test/mock/mock_stack_metrics_logging.cc @@ -55,6 +55,7 @@ struct log_mmc_transcode_rtt_stats log_mmc_transcode_rtt_stats; struct log_le_connection_status log_le_connection_status; struct log_le_device_in_accept_list log_le_device_in_accept_list; struct log_le_connection_lifecycle log_le_connection_lifecycle; +struct log_le_connection_completion log_le_connection_completion; } // namespace stack_metrics_logging } // namespace mock @@ -152,4 +153,11 @@ void log_le_connection_lifecycle(bluetooth::hci::Address address, bool is_connec inc_func_call_count(__func__); test::mock::stack_metrics_logging::log_le_connection_lifecycle(address, is_connect, is_direct); } + +void log_le_connection_completion(bluetooth::hci::Address address, bluetooth::hci::ErrorCode reason, + bool is_locally_initiated) { + inc_func_call_count(__func__); + test::mock::stack_metrics_logging::log_le_connection_completion(address, reason, + is_locally_initiated); +} // END mockcify generation diff --git a/system/test/mock/mock_stack_metrics_logging.h b/system/test/mock/mock_stack_metrics_logging.h index 413cbea629..40212e60ea 100644 --- a/system/test/mock/mock_stack_metrics_logging.h +++ b/system/test/mock/mock_stack_metrics_logging.h @@ -234,6 +234,19 @@ struct log_le_connection_lifecycle { }; extern struct log_le_device_in_accept_list log_le_device_in_accept_list; +// Name: log_le_connection_completion +struct log_le_connection_completion { + std::function<void(bluetooth::hci::Address address, bluetooth::hci::ErrorCode reason, + bool is_locally_initiated)> + body{[](bluetooth::hci::Address /* address */, bluetooth::hci::ErrorCode /* reason */, + bool /* is locally initiated */) {}}; + void operator()(bluetooth::hci::Address address, bluetooth::hci::ErrorCode reason, + bool is_locally_initiated) { + body(address, reason, is_locally_initiated); + } +}; +extern struct log_le_connection_completion log_le_connection_completion; + } // namespace stack_metrics_logging } // namespace mock } // namespace test |