Merge "AudioService: fix A2DP disconnection / reconnection"

am: 2faf009dda

Change-Id: I460a78b62640315aa79b4167be6c9793015218ae
This commit is contained in:
Jean-Michel Trivi
2019-12-19 14:01:30 -08:00
committed by android-build-merger

View File

@@ -195,7 +195,8 @@ public class AudioDeviceInventory {
} else { } else {
makeA2dpDeviceUnavailableNow(address, di.mDeviceCodecFormat); makeA2dpDeviceUnavailableNow(address, di.mDeviceCodecFormat);
} }
} } else if (state == BluetoothProfile.STATE_CONNECTED) {
// device is not already connected
if (a2dpVolume != -1) { if (a2dpVolume != -1) {
mDeviceBroker.postSetVolumeIndexOnDevice(AudioSystem.STREAM_MUSIC, mDeviceBroker.postSetVolumeIndexOnDevice(AudioSystem.STREAM_MUSIC,
// convert index to internal representation in VolumeStreamState // convert index to internal representation in VolumeStreamState
@@ -206,6 +207,7 @@ public class AudioDeviceInventory {
"onSetA2dpSinkConnectionState", a2dpCodec); "onSetA2dpSinkConnectionState", a2dpCodec);
} }
} }
}
/*package*/ void onSetA2dpSourceConnectionState( /*package*/ void onSetA2dpSourceConnectionState(
@NonNull BtHelper.BluetoothA2dpDeviceInfo btInfo, int state) { @NonNull BtHelper.BluetoothA2dpDeviceInfo btInfo, int state) {