Audio HAL: do not test input stream if no Built-in mic on primary
The test use to always test input stream, assuming that all devices had
built-in device on the primary Module.
Nevertheless, although uncommon, the mic could be on any module or even
not exist.
This patch makes sure that the input stream tests are only run if there
is a Built-in mic on the primary module.
As the policy config is now imported, it will be easy for the next HAL
version to add tests to test all supported audio config for each device.
Test: adb shell
cd /data/nativetest64/VtsHalAudioV4_0TargetTest
VtsHalAudioV4_0TargetTest --gtest_list_tests | grep Input
VtsHalAudioV4_0TargetTest
// Remove Mic from the available devices, the input tests should be skipped
sed -i /item.*Built-In.Mic/d /vendor/etc/audio_policy_configuration.xml
! VtsHalAudioV4_0TargetTest --gtest_list_tests | grep Input
VtsHalAudioV4_0TargetTest
// Remove the primary hal, test should fail
sed -i 's/"primary"/"notPrimary"/' /vendor/etc/audio_policy_configuration.xml
! VtsHalAudioV4_0TargetTest
Bug: 114303641
Bug: 111681420
Change-Id: Ibc1c1dadd6bcad18f184ab8c3bc75216c9f66adb
Signed-off-by:
Kevin Rocard <krocard@google.com>
Loading
Please register or sign in to comment