AudioService: better A2DP (dis)connection testing
A sequence of A2DP connection / disconnection / connection was supposed to be covered by a unit test in AudioDeviceBrokerTest with different timings. But if the test was run in the absence of background media playback, the disconnection event was not delayed by 1s after sending the BECOMING_NOISY event, and the connection / disconn / connection sequence was executed in the same order as the sender used, causing the test to succeed. This CL adds functionality in the adapter for AudioSystem to configure whether it is to simulate playback or not, so all tests can be run with and without. Also: - update system server adapter to support BECOMING_NOISY intent and make AudioDeviceBroker use the adapter code instead. - move the "no op" code of the adapters from the server folder (where it doesn't belong) to the test folder (because it should only ever be used in the context of a test). Bug: 142293357 Test: atest AudioDeviceBrokerTest Change-Id: Ic9877b5cbff97930bfc4bc1e48fee07d96799a86
Loading
Please register or sign in to comment