APM: Create multiple MSD patches
This change modifies setMsdPatch() by first renaming to setMsdPatches() and replaces its parameter with a pointer to DeviceVector, so that multiple devices can be patched from MSD. If none are specified it will establish MSD patches with all reported downstream output devices. It tears down existing MSD patches and creates new ones for those MSD patches that do not support new patch requests. We retain the existing MSD patches that already support new patch requests. In getBestMsdAudioProfileFor(), ensure output profiles considered for evaluating the best matching audio profile is supported by the output device under consideration. Refactor by placing common code that tears down current MSD patches into a new function called releaseMsdPatches(). When obtaining an output, getOutputForAttrInt() returns device ID of the default device if its ID matches that of one of the output devices provided by the engine. Add testing for dual MSD patch creation by parameterizing existing MSD tests for single and dual MSD patch cases. Add new unit test to exercise setMsdPatches and releaseMsdPatches. Make private MSD module member functions protected to enable testing. Bug: 135620198 Test: audiopolicy_tests Change-Id: I59a8976ce82dba04ca69347afc192e9143ef3629 Merged-In: I59a8976ce82dba04ca69347afc192e9143ef3629
Loading
Please register or sign in to comment