Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 24c1b944 authored by Jakub Pawłowski's avatar Jakub Pawłowski Committed by Automerger Merge Worker
Browse files

Merge "Do not return null as active device" am: 1e33487f am: a5056425

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/2007022

Change-Id: I6aafd604fe1d313c6705e2b3f01b8f10b62baf6c
parents c113d94a a5056425
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -860,6 +860,7 @@ public class AdapterService extends Service {
            errorLog(
                    "Cannot switch buffer size. The number of A2DP active devices is "
                            + activeDevices.size());
            return;
        }
        mA2dpService.switchCodecByBufferSize(activeDevices.get(0), isLowLatencyBufferSize);
    }
@@ -4100,16 +4101,22 @@ public class AdapterService extends Service {
                if (mHeadsetService == null) {
                    Log.e(TAG, "getActiveDevices: HeadsetService is null");
                } else {
                    activeDevices.add(mHeadsetService.getActiveDevice());
                    Log.i(TAG, "getActiveDevices: Headset device: " + activeDevices.get(0));
                    BluetoothDevice device = mHeadsetService.getActiveDevice();
                    if (device != null) {
                        activeDevices.add(device);
                    }
                    Log.i(TAG, "getActiveDevices: Headset device: " + device);
                }
                break;
            case BluetoothProfile.A2DP:
                if (mA2dpService == null) {
                    Log.e(TAG, "getActiveDevices: A2dpService is null");
                } else {
                    activeDevices.add(mA2dpService.getActiveDevice());
                    Log.i(TAG, "getActiveDevices: A2dp device: " + activeDevices.get(0));
                    BluetoothDevice device = mA2dpService.getActiveDevice();
                    if (device != null) {
                        activeDevices.add(device);
                    }
                    Log.i(TAG, "getActiveDevices: A2dp device: " + device);
                }
                break;
            case BluetoothProfile.HEARING_AID: