From e101f6ae5a31b10133d7d6f43bac888a87713e97 Mon Sep 17 00:00:00 2001 From: Pomai Ahlo Date: Mon, 3 Feb 2025 15:43:16 -0800 Subject: RFCOMM Metrics V2: Collect at port closure Collect metrics in system/stack/rfcomm after tPORT structure closes Bug: 374989690 Test: m com.android.bt && manual with Atom Tester Flag: EXEMPT metrics Change-Id: Idccdb2ab660e62a998d46293cea8495a761fa916 --- system/test/Android.bp | 7 +++++++ system/test/mock/mock_stack_rfcomm_metrics.cc | 21 +++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 system/test/mock/mock_stack_rfcomm_metrics.cc (limited to 'system/test') diff --git a/system/test/Android.bp b/system/test/Android.bp index 9ed0a083b5..fabb5e9847 100644 --- a/system/test/Android.bp +++ b/system/test/Android.bp @@ -297,6 +297,13 @@ filegroup { ], } +filegroup { + name: "TestMockStackRfcommMetrics", + srcs: [ + "mock/mock_stack_rfcomm_metrics.cc", + ], +} + filegroup { name: "TestMockStackRnr", srcs: [ diff --git a/system/test/mock/mock_stack_rfcomm_metrics.cc b/system/test/mock/mock_stack_rfcomm_metrics.cc new file mode 100644 index 0000000000..f44af222b1 --- /dev/null +++ b/system/test/mock/mock_stack_rfcomm_metrics.cc @@ -0,0 +1,21 @@ +/* + * Copyright 2025 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "rfc_metrics.h" +#include "stack/rfcomm/port_int.h" +#include "test/common/mock_functions.h" + +void port_collect_attempt_metrics(tPORT* /* p_port */) { inc_func_call_count(__func__); } -- cgit v1.2.3-59-g8ed1b