[BUG] AudioPolicy: fix AudioDeviceCallback
This CL fixes the AudioDeviceCallback that may report null device. When an output is reused by a SwBridge, upon release of SW bridge patch, releasing the patch of the Playback PatchTrack associated with the mixer thread will clear its patch and output devices. As the patch created for this output may not be recreated by AudioPolicyManager if routing does not change (same device or none if no activity on output), the device will not be updated, hence the AudioDeviceCallback will report null device. AudioPolicy will now force to recreate the output patch with same handle and valid when the SwBridge is released. AudioFlinger will erase previous mixer output patch and reuse hal patch handle to recreate/update the hal audio patch. Bug: 187800339 Bug: 228083206 Test: run a SwBridge audio use case on primary output (e.g. FM Radio), stop it, then play a stream on primary output. Ensure AudioDeviceCallback is called with non null device. Signed-off-by: Francois Gaffie <francois.gaffie@renault.com> Change-Id: I0b4f852280046cc596da9194cab4655316a026a4 Merged-In: I0b4f852280046cc596da9194cab4655316a026a4 (cherry picked from commit 7e39df23)
Loading
Please register or sign in to comment