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

Commit 0582c28f authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix NPE in companion device filter matching"

parents bbc8ad99 7151642b
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ import android.os.Parcelable;
import android.util.Log;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.regex.Pattern;

@@ -78,11 +79,12 @@ public class BluetoothDeviceFilterUtils {

    static boolean matchesServiceUuid(ParcelUuid serviceUuid, ParcelUuid serviceUuidMask,
            BluetoothDevice device) {
        ParcelUuid[] uuids = device.getUuids();
        final boolean result = serviceUuid == null ||
                ScanFilter.matchesServiceUuids(
                        serviceUuid,
                        serviceUuidMask,
                        Arrays.asList(device.getUuids()));
                        uuids == null ? Collections.emptyList() : Arrays.asList(uuids));
        if (DEBUG) debugLogMatchResult(result, device, serviceUuid);
        return result;
    }