AudioService: fix missing AUDIO_BECOMING_NOISY intent

If Bluetooth service calls onBluetoothA2dpDeviceConfigChange() before
setBluetoothA2dpDeviceConnectionState(), there is a chance that the
first method fails leaving the A2DP device state disconnected in audio
policy manager while it appears as connected in AudioService causing a
failure to send the AUDIO_BECOMING_NOISY intent.

Bug: 37687852
Test: Verify AUDIO_BECOMING_NOISY intent is sent even if race
condition occurs.

Change-Id: I014d145e7da5e7d267991ffb2ff50626e71247eb
1 file changed