Replacing getActiveDevice by btAdapter.getActiveDevices()

BluetoothProfile.getActiveDevice() is hidden, packages
should call BluetoothAdapter.getActiveDevices(profile)
instead.

Tag: #feature
Bug: 200202780
Test: build
Change-Id: Id18658de82a7e8292942951a3832a36465a69da3
This commit is contained in:
Etienne Ruffieux
2022-02-01 17:08:15 +00:00
parent dac3f891ae
commit 9692c59d3a
13 changed files with 119 additions and 30 deletions

View File

@@ -69,7 +69,7 @@ public class BluetoothCodecDialogPreferenceController extends
if (bluetoothA2dp == null) {
return index;
}
final BluetoothDevice activeDevice = bluetoothA2dp.getActiveDevice();
final BluetoothDevice activeDevice = getA2dpActiveDevice();
if (activeDevice == null) {
Log.d(TAG, "Unable to get selectable index. No Active Bluetooth device");
return index;
@@ -93,7 +93,7 @@ public class BluetoothCodecDialogPreferenceController extends
int codecPriorityValue = BluetoothCodecConfig.CODEC_PRIORITY_DEFAULT;
switch (index) {
case 0:
final BluetoothDevice activeDevice = mBluetoothA2dp.getActiveDevice();
final BluetoothDevice activeDevice = getA2dpActiveDevice();
codecTypeValue = getHighestCodec(mBluetoothA2dp, activeDevice,
getSelectableConfigs(activeDevice));
codecPriorityValue = BluetoothCodecConfig.CODEC_PRIORITY_HIGHEST;