summaryrefslogtreecommitdiff
path: root/system/test
diff options
context:
space:
mode:
author Pomai Ahlo <poahlo@google.com> 2025-02-03 15:14:03 -0800
committer Pomai Ahlo <poahlo@google.com> 2025-02-20 13:27:50 -0800
commit86d90eee9dd37eccdd19449b9d72b883df060f9b (patch)
tree38f05153ea151343762279bc1e16ff82d93ae889 /system/test
parent0503ef80d9d1f90c6ed28cda7dae07ec62706a9b (diff)
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
Diffstat (limited to 'system/test')
-rw-r--r--system/test/Android.bp8
-rw-r--r--system/test/mock/mock_bta_rfc_metrics.cc34
2 files changed, 42 insertions, 0 deletions
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
@@ -142,6 +142,13 @@ filegroup {
}
filegroup {
+ name: "TestMockBtaRfcMetrics",
+ srcs: [
+ "mock/mock_bta_rfc_metrics.cc",
+ ],
+}
+
+filegroup {
name: "TestMockBtaScn",
srcs: [
"mock/mock_bta_scn.cc",
@@ -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__);
+}