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

Commit 27bdff77 authored by John Spurlock's avatar John Spurlock
Browse files

QS: Deal with null uuids in BT controller.

Fix crash when the device is no longer available.

Bug:16355690
Change-Id: I1cf652a408fa221649950d728bc88dd93fc93b65
parent bcc0eae1
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -180,8 +180,13 @@ public class BluetoothControllerImpl implements BluetoothController {
        final BluetoothDevice device = (BluetoothDevice) pd.tag;
        final String action = connect ? "connect" : "disconnect";
        if (DEBUG) Log.d(TAG, action + " " + deviceToString(device));
        final ParcelUuid[] uuids = device.getUuids();
        if (uuids == null) {
            Log.w(TAG, "No uuids returned, aborting " + action + " for " + deviceToString(device));
            return;
        }
        final SparseBooleanArray profiles = new SparseBooleanArray();
        for (ParcelUuid uuid : device.getUuids()) {
        for (ParcelUuid uuid : uuids) {
            final int profile = uuidToProfile(uuid);
            if (profile == 0) {
                Log.w(TAG, "Device " + deviceToString(device) + " has an unsupported uuid: "