Code example for BluetoothDevice

Methods: getBluetoothClass, getUuids

0
    /** Parent class of filters based on UUID and/or Bluetooth class. */ 
    private abstract static class ClassUuidFilter implements Filter { 
        abstract boolean matches(ParcelUuid[] uuids, BluetoothClass btClass);
 
        public boolean matches(BluetoothDevice device) {
            return matches(device.getUuids(), device.getBluetoothClass());
        } 
    } 
 
    /** Filter that matches devices that support AUDIO profiles. */ 
    private static final class AudioFilter extends ClassUuidFilter { 
        @Override 
        boolean matches(ParcelUuid[] uuids, BluetoothClass btClass) {
            if (uuids != null) {
                if (BluetoothUuid.containsAnyUuid(uuids, A2dpProfile.SINK_UUIDS)) {
                    return true; 
                } 
                if (BluetoothUuid.containsAnyUuid(uuids, HeadsetProfile.UUIDS)) {
                    return true; 
                } 
            } else if (btClass != null) {