summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jakub Rotkiewicz <rotkiewicz@google.com> 2025-01-07 12:42:36 +0000
committer Jakub Rotkiewicz <rotkiewicz@google.com> 2025-01-15 08:42:09 +0000
commit51ed3b93af3a3fde297c3f37511312f7d5448817 (patch)
tree09452813169f8432f2b241f34e58eb77c68e454b
parente2f20d29fd94a3f988a8f5af2bd8e021e38374cf (diff)
bta: change avdt open timeout for PTS test
In the test A2DP/SNK/SYN/BV-01-C the PTS sends open command in around ~10 seconds, which is way longer than the stack allows and it has to be handled in other way. This CL adds sysprop that will setup the timeout to a greater value for PTS test purpose only. Bug: 384490929 Flag: EXEMPT - test only Test: atest pts-bot:A2DP/SNK/SYN/BV-01-C -v Change-Id: Id5c4b7dbe2a176facee5eb843ddeaf785ca5c4e9
-rw-r--r--android/pandora/server/configs/pts_bot_tests_config.json16
-rw-r--r--android/pandora/server/configs/pts_bot_tests_config_auto.json17
-rw-r--r--sysprop/a2dp.sysprop7
-rw-r--r--system/bta/av/bta_av_aact.cc9
4 files changed, 46 insertions, 3 deletions
diff --git a/android/pandora/server/configs/pts_bot_tests_config.json b/android/pandora/server/configs/pts_bot_tests_config.json
index 91e77b7ae2..7b44a66f18 100644
--- a/android/pandora/server/configs/pts_bot_tests_config.json
+++ b/android/pandora/server/configs/pts_bot_tests_config.json
@@ -3251,6 +3251,14 @@
"VCP/VC/SPE/BI-19-C",
"VCP/VC/SPE/BI-20-C"
]
+ },
+ {
+ "flags": [
+ "avdt_accept_open_timeout_ms"
+ ],
+ "tests": [
+ "A2DP/SNK/SYN/BV-01-C"
+ ]
}
],
"system_properties": [
@@ -3298,6 +3306,14 @@
"tests": [
"HFP/AG"
]
+ },
+ {
+ "system_properties": {
+ "bluetooth.a2dp.avdt_accept_open_timeout_ms": "15000"
+ },
+ "tests": [
+ "A2DP/SNK/SYN/BV-01-C"
+ ]
}
]
}
diff --git a/android/pandora/server/configs/pts_bot_tests_config_auto.json b/android/pandora/server/configs/pts_bot_tests_config_auto.json
index 6b319a0179..425b79c8e8 100644
--- a/android/pandora/server/configs/pts_bot_tests_config_auto.json
+++ b/android/pandora/server/configs/pts_bot_tests_config_auto.json
@@ -375,7 +375,14 @@
"SPP": {},
"VCP": {}
},
- "flags": {},
+ "flags": {
+ "flags": [
+ "avdt_accept_open_timeout_ms"
+ ],
+ "tests": [
+ "A2DP/SNK/SYN/BV-01-C"
+ ]
+ },
"system_properties": [
{
"system_properties": {
@@ -421,6 +428,14 @@
"tests": [
"HFP/AG"
]
+ },
+ {
+ "system_properties": {
+ "bluetooth.a2dp.avdt_accept_open_timeout_ms": "15000"
+ },
+ "tests": [
+ "A2DP/SNK/SYN/BV-01-C"
+ ]
}
]
}
diff --git a/sysprop/a2dp.sysprop b/sysprop/a2dp.sysprop
index 80b359c390..ae02fbbb99 100644
--- a/sysprop/a2dp.sysprop
+++ b/sysprop/a2dp.sysprop
@@ -9,3 +9,10 @@ prop {
prop_name: "bluetooth.a2dp.src_sink_coexist.enabled"
}
+prop {
+ api_name: "avdt_accept_open_timeout_ms"
+ type: Integer
+ scope: Internal
+ access: Readonly
+ prop_name: "bluetooth.a2dp.avdt_accept_open_timeout_ms"
+} \ No newline at end of file
diff --git a/system/bta/av/bta_av_aact.cc b/system/bta/av/bta_av_aact.cc
index 8cb73a4402..5854c8aa6c 100644
--- a/system/bta/av/bta_av_aact.cc
+++ b/system/bta/av/bta_av_aact.cc
@@ -26,6 +26,7 @@
#define LOG_TAG "bluetooth-a2dp"
+#include <android_bluetooth_sysprop.h>
#include <bluetooth/log.h>
#include <com_android_bluetooth_flags.h>
@@ -1134,7 +1135,11 @@ void bta_av_setconfig_rsp(tBTA_AV_SCB* p_scb, tBTA_AV_DATA* p_data) {
if (!p_scb->accept_open_timer) {
p_scb->accept_open_timer = alarm_new("accept_open_timer");
}
- alarm_set_on_mloop(p_scb->accept_open_timer, BTA_AV_ACCEPT_OPEN_TIMEOUT_MS,
+ const uint64_t accept_open_timeout =
+ android::sysprop::bluetooth::A2dp::avdt_accept_open_timeout_ms().value_or(
+ BTA_AV_ACCEPT_OPEN_TIMEOUT_MS);
+ log::debug("accept_open_timeout = {} ms", accept_open_timeout);
+ alarm_set_on_mloop(p_scb->accept_open_timer, accept_open_timeout,
bta_av_accept_open_timer_cback, UINT_TO_PTR(p_scb->hdi));
}
}
@@ -3402,4 +3407,4 @@ static void bta_av_accept_open_timer_cback(void* data) {
tBTA_AV_API_OPEN* p_buf = (tBTA_AV_API_OPEN*)osi_malloc(sizeof(tBTA_AV_API_OPEN));
memcpy(p_buf, &(p_scb->open_api), sizeof(tBTA_AV_API_OPEN));
bta_sys_sendmsg(p_buf);
-} \ No newline at end of file
+}