Skip to content
Commit 85d7ba1c authored by Jean-Michel Trivi's avatar Jean-Michel Trivi
Browse files

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
parent f58030e8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment