Add support for Multi-A2DP state machines per device
Update usage of A2dpService API calls that take BluetoothDevice as an additional argument. If the BluetoothDevice argument is null, the API applies to the device that is currently the Active A2DP device. Bug: 69269748 Test: Manual Change-Id: I8031fa4b4256890dcb486228185baf93debb102d Merged-In: I7417b7b0741f706df475cb2b27fbe6525f744269
This commit is contained in:
@@ -1895,7 +1895,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
|
|||||||
|
|
||||||
synchronized (mBluetoothA2dpLock) {
|
synchronized (mBluetoothA2dpLock) {
|
||||||
if (mBluetoothA2dp != null) {
|
if (mBluetoothA2dp != null) {
|
||||||
codecStatus = mBluetoothA2dp.getCodecStatus();
|
codecStatus = mBluetoothA2dp.getCodecStatus(null); // Use current active device
|
||||||
if (codecStatus != null) {
|
if (codecStatus != null) {
|
||||||
codecConfig = codecStatus.getCodecConfig();
|
codecConfig = codecStatus.getCodecConfig();
|
||||||
codecsLocalCapabilities = codecStatus.getCodecsLocalCapabilities();
|
codecsLocalCapabilities = codecStatus.getCodecsLocalCapabilities();
|
||||||
@@ -2123,14 +2123,14 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
|
|||||||
case 6:
|
case 6:
|
||||||
synchronized (mBluetoothA2dpLock) {
|
synchronized (mBluetoothA2dpLock) {
|
||||||
if (mBluetoothA2dp != null) {
|
if (mBluetoothA2dp != null) {
|
||||||
mBluetoothA2dp.enableOptionalCodecs();
|
mBluetoothA2dp.enableOptionalCodecs(null); // Use current active device
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
case 7:
|
case 7:
|
||||||
synchronized (mBluetoothA2dpLock) {
|
synchronized (mBluetoothA2dpLock) {
|
||||||
if (mBluetoothA2dp != null) {
|
if (mBluetoothA2dp != null) {
|
||||||
mBluetoothA2dp.disableOptionalCodecs();
|
mBluetoothA2dp.disableOptionalCodecs(null); // Use current active device
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@@ -2253,7 +2253,8 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
|
|||||||
|
|
||||||
synchronized (mBluetoothA2dpLock) {
|
synchronized (mBluetoothA2dpLock) {
|
||||||
if (mBluetoothA2dp != null) {
|
if (mBluetoothA2dp != null) {
|
||||||
mBluetoothA2dp.setCodecConfigPreference(codecConfig);
|
// Use current active device
|
||||||
|
mBluetoothA2dp.setCodecConfigPreference(null, codecConfig);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user