From 655b480b2bc00b078a03cf26327687428fd6ae63 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Fri, 8 Aug 2014 14:37:00 +0300 Subject: [PATCH] android/tester: Load audio module This is necessary to be able to do A2DP tests. --- android/tester-main.c | 11 ++++++++++- android/tester-main.h | 2 ++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/android/tester-main.c b/android/tester-main.c index a9ccfcd4a..7d174701b 100644 --- a/android/tester-main.c +++ b/android/tester-main.c @@ -1169,6 +1169,15 @@ static bool setup_base(struct test_data *data) close(signal_fd[0]); + err = hw_get_module_by_class(AUDIO_HARDWARE_MODULE_ID, + AUDIO_HARDWARE_MODULE_ID_A2DP, &module); + if (err) + return false; + + err = audio_hw_device_open(module, &data->audio); + if (err) + return false; + err = hw_get_module(BT_HARDWARE_MODULE_ID, &module); if (err) return false; @@ -1187,7 +1196,6 @@ static bool setup_base(struct test_data *data) if (!(data->steps = queue_new())) return false; - return true; } @@ -1418,6 +1426,7 @@ static void teardown(const void *test_data) } data->device->close(data->device); + audio_hw_device_close(data->audio); if (!data->bluetoothd_pid) tester_teardown_complete(); diff --git a/android/tester-main.h b/android/tester-main.h index bdf54b299..ddca69c38 100644 --- a/android/tester-main.h +++ b/android/tester-main.h @@ -43,6 +43,7 @@ #include "src/shared/queue.h" #include +#include #include #include #include @@ -279,6 +280,7 @@ typedef enum { struct test_data { struct mgmt *mgmt; + audio_hw_device_t *audio; struct hw_device_t *device; struct hciemu *hciemu; enum hciemu_type hciemu_type; -- 2.47.3