Audio policy: fix HwModuleCollection::getDeviceDescriptor
The deprecated method AudioManager.isBluetoothA2dpOn() calls getDeviceConnectionState on APM with an empty address, which caused HwModuleCollection::getDeviceDescriptor to set an empty address on the DeviceDescriptor for the currently connected A2DP device. This method is called by MediaRouter. When the address was reset, the java listener for audio device connection monitoring was reporting the connection of an A2DP device with an empty address, which in turn caused AvrcpManager to behave as if the audio device connection failed. If MediaRouter called isBluetoothA2dpOn() before AvrcpManager received its called for device connection, the error would occur. Bug: 132416679 Test: call isBluetoothA2dpOn() and check for valid address in dumpsys media.audio_policy Test: atest AudioServiceHostTest#testInjectForRecord ; atest AudioHostTest ; atest AudioPlaybackCaptureTest Change-Id: I1370edbbca46657506a990855d06a176f07c54d3
Loading
Please register or sign in to comment