From 86d90eee9dd37eccdd19449b9d72b883df060f9b Mon Sep 17 00:00:00 2001 From: Pomai Ahlo Date: Mon, 3 Feb 2025 15:14:03 -0800 Subject: RFCOMM metrics V2: Collect metrics in bta Collect RFCOMM metrics in bta layer: These are cases where the port never opened Bug: 374989690 Test: m com.android.bt && manual with Atom Tester Flag: EXEMPT metrics Change-Id: Ie109fab66cf0166cd1ccbb933fa44b1864dd760e --- system/test/Android.bp | 8 ++++++++ system/test/mock/mock_bta_rfc_metrics.cc | 34 ++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 system/test/mock/mock_bta_rfc_metrics.cc (limited to 'system/test') diff --git a/system/test/Android.bp b/system/test/Android.bp index c965355dcc..9ed0a083b5 100644 --- a/system/test/Android.bp +++ b/system/test/Android.bp @@ -141,6 +141,13 @@ filegroup { ], } +filegroup { + name: "TestMockBtaRfcMetrics", + srcs: [ + "mock/mock_bta_rfc_metrics.cc", + ], +} + filegroup { name: "TestMockBtaScn", srcs: [ @@ -189,6 +196,7 @@ filegroup { ":TestMockBtaLeAudioHalVerifier", ":TestMockBtaPan", ":TestMockBtaRas", + ":TestMockBtaRfcMetrics", ":TestMockBtaSdp", ":TestMockBtaSys", ":TestMockBtaVc", diff --git a/system/test/mock/mock_bta_rfc_metrics.cc b/system/test/mock/mock_bta_rfc_metrics.cc new file mode 100644 index 0000000000..9c1c0cced2 --- /dev/null +++ b/system/test/mock/mock_bta_rfc_metrics.cc @@ -0,0 +1,34 @@ +/* + * 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 "bta/include/bta_jv_api.h" +#include "bta/include/bta_rfcomm_metrics.h" +#include "test/common/mock_functions.h" +#include "types/raw_address.h" + +void bta_collect_rfc_metrics_after_sdp_fail(tBTA_JV_STATUS /* sdp_status */, RawAddress /* addr */, + int /* app_uid */, int /* security */, + bool /* is_server */, uint64_t /* sdp_duration */) { + inc_func_call_count(__func__); +} + +void bta_collect_rfc_metrics_after_port_fail(tPORT_RESULT /* port_result */, + bool /* sdp_initiated */, + tBTA_JV_STATUS /* sdp_status */, RawAddress /* addr */, + int /* app_uid */, int /* security */, + bool /* is_server */, uint64_t /* sdp_duration_ms */) { + inc_func_call_count(__func__); +} -- cgit v1.2.3-59-g8ed1b