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

Commit bd898c9e authored by Christine Hallstrom's avatar Christine Hallstrom Committed by Gerrit Code Review
Browse files

Merge "Unhide BluetoothDevice#getAddressType" into main

parents 0e6aa8dc c406397e
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -534,6 +534,7 @@ package android.bluetooth {
    method public int describeContents();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean fetchUuidsWithSdp();
    method public String getAddress();
    method @FlaggedApi("com.android.bluetooth.flags.get_address_type_api") public int getAddressType();
    method @Nullable @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public String getAlias();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public android.bluetooth.BluetoothClass getBluetoothClass();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public int getBondState();
@@ -554,6 +555,7 @@ package android.bluetooth {
    field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_NAME_CHANGED = "android.bluetooth.device.action.NAME_CHANGED";
    field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_PAIRING_REQUEST = "android.bluetooth.device.action.PAIRING_REQUEST";
    field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_UUID = "android.bluetooth.device.action.UUID";
    field @FlaggedApi("com.android.bluetooth.flags.get_address_type_api") public static final int ADDRESS_TYPE_ANONYMOUS = 255; // 0xff
    field public static final int ADDRESS_TYPE_PUBLIC = 0; // 0x0
    field public static final int ADDRESS_TYPE_RANDOM = 1; // 0x1
    field public static final int ADDRESS_TYPE_UNKNOWN = 65535; // 0xffff
+6 −4
Original line number Diff line number Diff line
@@ -1360,7 +1360,8 @@ public final class BluetoothDevice implements Parcelable, Attributable {
    public static final int ADDRESS_TYPE_UNKNOWN = 0xFFFF;

    /** Address type used to indicate an anonymous advertisement. */
    private static final int ADDRESS_TYPE_ANONYMOUS = 0xFF;
    @FlaggedApi(Flags.FLAG_GET_ADDRESS_TYPE_API)
    public static final int ADDRESS_TYPE_ANONYMOUS = 0xFF;

    private static final String NULL_MAC_ADDRESS = "00:00:00:00:00:00";

@@ -1569,12 +1570,13 @@ public final class BluetoothDevice implements Parcelable, Attributable {
    }

    /**
     * Returns the address type of this BluetoothDevice.
     * Returns the address type of this BluetoothDevice, one of {@link ADDRESS_TYPE_PUBLIC}, {@link
     * ADDRESS_TYPE_RANDOM}, {@link ADDRESS_TYPE_ANONYMOUS}, or {@link ADDRESS_TYPE_UNKNOWN}.
     *
     * @return Bluetooth address type
     * @hide
     */
    public int getAddressType() {
    @FlaggedApi(Flags.FLAG_GET_ADDRESS_TYPE_API)
    public @AddressType int getAddressType() {
        if (DBG) Log.d(TAG, "mAddressType: " + mAddressType);
        return mAddressType;
    }