diff options
Diffstat (limited to 'framework/java/android')
-rw-r--r-- | framework/java/android/bluetooth/BluetoothAdapter.java | 10 | ||||
-rw-r--r-- | framework/java/android/bluetooth/le/ScanFilter.java | 80 |
2 files changed, 46 insertions, 44 deletions
diff --git a/framework/java/android/bluetooth/BluetoothAdapter.java b/framework/java/android/bluetooth/BluetoothAdapter.java index 4d96ebc518..67515bef5c 100644 --- a/framework/java/android/bluetooth/BluetoothAdapter.java +++ b/framework/java/android/bluetooth/BluetoothAdapter.java @@ -1007,8 +1007,8 @@ public final class BluetoothAdapter { /** * Get a {@link BluetoothDevice} object for the given Bluetooth hardware * address. - * <p>Valid Bluetooth hardware addresses must be upper case, in a format - * such as "00:11:22:33:AA:BB". The helper {@link #checkBluetoothAddress} is + * <p>Valid Bluetooth hardware addresses must be upper case, in big endian byte order, and in a + * format such as "00:11:22:33:AA:BB". The helper {@link #checkBluetoothAddress} is * available to validate a Bluetooth address. * <p>A {@link BluetoothDevice} will always be returned for a valid * hardware address, even if this adapter has never seen that device. @@ -1027,8 +1027,8 @@ public final class BluetoothAdapter { /** * Get a {@link BluetoothDevice} object for the given Bluetooth hardware * address and addressType. - * <p>Valid Bluetooth hardware addresses must be upper case, in a format - * such as "00:11:22:33:AA:BB". The helper {@link #checkBluetoothAddress} is + * <p>Valid Bluetooth hardware addresses must be upper case, in big endian byte order, and in a + * format such as "00:11:22:33:AA:BB". The helper {@link #checkBluetoothAddress} is * available to validate a Bluetooth address. * <p>A {@link BluetoothDevice} will always be returned for a valid * hardware address and type, even if this adapter has never seen that device. @@ -3396,7 +3396,7 @@ public final class BluetoothAdapter { * can use the same UUID to query our SDP server and discover which channel * to connect to. This SDP record will be removed when this socket is * closed, or if this application closes unexpectedly. - * <p>Use {@link BluetoothDevice#createRfcommSocketToServiceRecord} to + * <p>Use {@link BluetoothDevice#createInsecureRfcommSocketToServiceRecord} to * connect to this socket from another device using the same {@link UUID}. * * @param name service name for SDP record diff --git a/framework/java/android/bluetooth/le/ScanFilter.java b/framework/java/android/bluetooth/le/ScanFilter.java index 737f58f4a2..b72e7ef31a 100644 --- a/framework/java/android/bluetooth/le/ScanFilter.java +++ b/framework/java/android/bluetooth/le/ScanFilter.java @@ -820,13 +820,15 @@ public final class ScanFilter implements Parcelable { } /** - * Set filter on device address. + * Set a scan filter on the remote device address. + * <p> + * The address passed to this API must be in big endian byte order. It needs to be in the + * format of "01:02:03:AB:CD:EF". The device address can be validated using + * {@link BluetoothAdapter#checkBluetoothAddress}. The @AddressType is defaulted to + * {@link BluetoothDevice#ADDRESS_TYPE_PUBLIC}. * - * @param deviceAddress The device Bluetooth address for the filter. It needs to be in the - * format of "01:02:03:AB:CD:EF". The device address can be validated using {@link - * BluetoothAdapter#checkBluetoothAddress}. The @AddressType is defaulted to {@link - * BluetoothDevice#ADDRESS_TYPE_PUBLIC} - * @throws IllegalArgumentException If the {@code deviceAddress} is invalid. + * @param deviceAddress the remote device Bluetooth address for the filter + * @throws IllegalArgumentException if the {@code deviceAddress} is invalid */ public Builder setDeviceAddress(String deviceAddress) { if (deviceAddress == null) { @@ -837,20 +839,20 @@ public final class ScanFilter implements Parcelable { } /** - * Set filter on Address with AddressType - * - * <p>This key is used to resolve a private address from a public address. + * Set a scan filter on the remote device address with an address type. + * <p> + * The address passed to this API must be in big endian byte order. It needs to be in the + * format of "01:02:03:AB:CD:EF". The device address can be validated using + * {@link BluetoothAdapter#checkBluetoothAddress}. * - * @param deviceAddress The device Bluetooth address for the filter. It needs to be in the - * format of "01:02:03:AB:CD:EF". The device address can be validated using {@link - * BluetoothAdapter#checkBluetoothAddress}. May be any type of address. + * @param deviceAddress the remote device Bluetooth address for the filter * @param addressType indication of the type of address - * e.g. {@link BluetoothDevice#ADDRESS_TYPE_PUBLIC} - * or {@link BluetoothDevice#ADDRESS_TYPE_RANDOM} * - * @throws IllegalArgumentException If the {@code deviceAddress} is invalid. - * @throws IllegalArgumentException If the {@code addressType} is invalid length - * @throws NullPointerException if {@code deviceAddress} is null. + * @throws IllegalArgumentException If the {@code deviceAddress} is invalid + * @throws IllegalArgumentException If the {@code addressType} is invalid length or is not + * either {@link BluetoothDevice#ADDRESS_TYPE_PUBLIC} or + * {@link BluetoothDevice#ADDRESS_TYPE_RANDOM} + * @throws NullPointerException if {@code deviceAddress} is null * * @hide */ @@ -862,25 +864,25 @@ public final class ScanFilter implements Parcelable { } /** - * Set filter on Address with AddressType and the Identity Resolving Key (IRK). - * - * <p>The IRK is used to resolve a {@link BluetoothDevice#ADDRESS_TYPE_PUBLIC} from - * a PRIVATE_ADDRESS type. + * Set a scan filter on the remote device address with an address type and the Identity + * Resolving Key (IRK). + * <p> + * The address passed to this API must be either a public or random static address in big + * endian byte order. It needs to be in the format of "01:02:03:AB:CD:EF". The device + * address can be validated using {@link BluetoothAdapter#checkBluetoothAddress}. + * <p> + * The IRK is used to resolve a static address from a private address. The IRK must be + * provided in little endian byte order. * - * @param deviceAddress The device Bluetooth address for the filter. It needs to be in the - * format of "01:02:03:AB:CD:EF". The device address can be validated using {@link - * BluetoothAdapter#checkBluetoothAddress}. This Address type must only be PUBLIC OR RANDOM - * STATIC. + * @param deviceAddress the remote device Bluetooth address for the filter * @param addressType indication of the type of address - * e.g. {@link BluetoothDevice#ADDRESS_TYPE_PUBLIC} - * or {@link BluetoothDevice#ADDRESS_TYPE_RANDOM} - * @param irk non-null byte array representing the Identity Resolving Key + * @param irk non-null little endian byte array representing the Identity Resolving Key * - * @throws IllegalArgumentException If the {@code deviceAddress} is invalid. - * @throws IllegalArgumentException if the {@code irk} is invalid length. - * @throws IllegalArgumentException If the {@code addressType} is invalid length or is not - * PUBLIC or RANDOM STATIC when an IRK is present. - * @throws NullPointerException if {@code deviceAddress} or {@code irk} is null. + * @throws IllegalArgumentException If the {@code deviceAddress} is invalid + * @throws IllegalArgumentException if the {@code irk} is invalid length + * @throws IllegalArgumentException If the {@code addressType} is an invalid length or is + * not PUBLIC or RANDOM STATIC + * @throws NullPointerException if {@code deviceAddress} or {@code irk} is null * * @hide */ @@ -905,13 +907,13 @@ public final class ScanFilter implements Parcelable { * format of "01:02:03:AB:CD:EF". The device address can be validated using {@link * BluetoothAdapter#checkBluetoothAddress}. * @param addressType indication of the type of address - * e.g. {@link BluetoothDevice#ADDRESS_TYPE_PUBLIC} - * @param irk non-null byte array representing the Identity Resolving Address; nullable - * internally. + * @param irk non-null little endian byte array representing the Identity Resolving Key; + * nullable internally. * - * @throws IllegalArgumentException If the {@code deviceAddress} is invalid. - * @throws IllegalArgumentException If the {@code addressType} is invalid length. - * @throws NullPointerException if {@code deviceAddress} is null. + * @throws IllegalArgumentException if the {@code deviceAddress} is invalid + * @throws IllegalArgumentException if the {@code addressType} is not PUBLIC or RANDOM + * STATIC when an IRK is present + * @throws NullPointerException if {@code deviceAddress} is null * * @hide */ |