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

Commit f2b901e4 authored by Christine Hallstrom's avatar Christine Hallstrom
Browse files

Clarify documentation on address returned in scan results

Test: m com.android.btservices
Bug: 288319369
Change-Id: Id711b5127a3c7fc1de97a19edea08b35b7bfdd08
parent 1f86922b
Loading
Loading
Loading
Loading
+12 −10
Original line number Diff line number Diff line
@@ -771,31 +771,33 @@ public final class ScanFilter implements Parcelable {
        /**
         * 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
         *
         * <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
         *
         * <p>The IRK is used to resolve a static address from a private address. The IRK must be
         * provided in little endian byte order.
         *
         * <p>Note if the device with this IRK is already bonded, calling {@link
         * BluetoothDevice#getAddress} on the {@link ScanResult} using this filter will return the
         * device address that was used to initiate bonding, and may not match the address passed
         * into this method in that scenario.
         *
         * @param deviceAddress the remote device Bluetooth address for the filter
         * @param addressType indication of the type of address
         * @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 an invalid length or is
         *     not PUBLIC or RANDOM STATIC
         * @throws NullPointerException if {@code deviceAddress} or {@code irk} is null
         *
         * @hide
         */
        @NonNull
        @SystemApi
        public Builder setDeviceAddress(@NonNull String deviceAddress,
                                        @AddressType int addressType,
                                        @NonNull byte[] irk) {
        public Builder setDeviceAddress(
                @NonNull String deviceAddress, @AddressType int addressType, @NonNull byte[] irk) {
            requireNonNull(irk);
            if (irk.length != LEN_IRK_OCTETS) {
                throw new IllegalArgumentException("'irk' is invalid length!");
+4 −1
Original line number Diff line number Diff line
@@ -204,7 +204,10 @@ public final class ScanResult implements Parcelable, Attributable {
    }

    /**
     * Returns the remote Bluetooth device identified by the Bluetooth device address.
     * Returns the remote Bluetooth device identified by the Bluetooth device address. If the device
     * is bonded, calling {@link BluetoothDevice#getAddress} on the object returned by this method
     * will return the address that was originally bonded with (either identity address or random
     * address).
     */
    public BluetoothDevice getDevice() {
        return mDevice;