Merge "AudioService: fix A2DP disconnection / reconnection"
This commit is contained in:
@@ -195,15 +195,17 @@ 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) {
|
||||||
|
mDeviceBroker.postSetVolumeIndexOnDevice(AudioSystem.STREAM_MUSIC,
|
||||||
|
// convert index to internal representation in VolumeStreamState
|
||||||
|
a2dpVolume * 10,
|
||||||
|
AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP, "onSetA2dpSinkConnectionState");
|
||||||
|
}
|
||||||
|
makeA2dpDeviceAvailable(address, BtHelper.getName(btDevice),
|
||||||
|
"onSetA2dpSinkConnectionState", a2dpCodec);
|
||||||
}
|
}
|
||||||
if (a2dpVolume != -1) {
|
|
||||||
mDeviceBroker.postSetVolumeIndexOnDevice(AudioSystem.STREAM_MUSIC,
|
|
||||||
// convert index to internal representation in VolumeStreamState
|
|
||||||
a2dpVolume * 10,
|
|
||||||
AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP, "onSetA2dpSinkConnectionState");
|
|
||||||
}
|
|
||||||
makeA2dpDeviceAvailable(address, BtHelper.getName(btDevice),
|
|
||||||
"onSetA2dpSinkConnectionState", a2dpCodec);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user