From 6de19308abf263b3510141c5c6e777e4f3e528b6 Mon Sep 17 00:00:00 2001 From: Mikhail Naganov Date: Wed, 21 Dec 2022 23:14:37 +0000 Subject: [PATCH] audio VTS: Use the right device type in PcmOnlyConfigInputStreamTest The fix in https://r.android.com/2322475 modifies the device address, which becomes 'IN_DEFAULT' for the telephony case. As a result, tests that verify capture position were not skipped, and they do fail on certain platforms when there is no active telephone call. The fix is to use the initial device type which was passed to the test as a parameter, not the adjusted one. Bug: 263305254 Test: atest VtsHalAudioV7_0TargetTest Test: atest VtsHalAudioV7_1TargetTest Change-Id: Ied7134a1bd97e70dcc2400e0827810f9d71a6438 (cherry picked from commit 7029707e346d0b124bfe13157be01d86179f1210) --- .../vts/functional/7.0/AudioPrimaryHidlHalTest.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/audio/core/all-versions/vts/functional/7.0/AudioPrimaryHidlHalTest.cpp b/audio/core/all-versions/vts/functional/7.0/AudioPrimaryHidlHalTest.cpp index 505c54c1df..95564e010b 100644 --- a/audio/core/all-versions/vts/functional/7.0/AudioPrimaryHidlHalTest.cpp +++ b/audio/core/all-versions/vts/functional/7.0/AudioPrimaryHidlHalTest.cpp @@ -687,7 +687,12 @@ class PcmOnlyConfigInputStreamTest : public InputStreamTest { InputStreamTest::TearDown(); } - bool canQueryCapturePosition() const { return !xsd::isTelephonyDevice(address.deviceType); } + bool canQueryCapturePosition() const { + // See b/263305254 and b/259636577. Must use the device initially passed in + // as a parameter, not 'address' which gets adjusted during test setup for + // the telephony case. + return !xsd::isTelephonyDevice(getAttachedDeviceAddress().deviceType); + } void createPatchIfNeeded() { if (areAudioPatchesSupported()) {