summaryrefslogtreecommitdiff
path: root/core/java/android/bluetooth/BluetoothDevice.java
diff options
context:
space:
mode:
authorMartin Brabham <optedoblivion@google.com>2021-03-16 21:14:40 -0700
committerMartin Brabham <optedoblivion@google.com>2021-03-20 15:13:24 -0700
commit045fe260e1677f7442fbecc66085acd1dd23ff7b (patch)
tree1f36daee836963e0de4e57bfea506d8460e772ef /core/java/android/bluetooth/BluetoothDevice.java
parent55fe87b2f646adc09a600344bca6b89c0ea9c28e (diff)
Add new @SystemApi for specifying AddressType and IRK
Bug: 178234318 Test: compiles and runs Tag: #feature Change-Id: Ib67e681af01260df98602003b2aca47963494c6f
Diffstat (limited to 'core/java/android/bluetooth/BluetoothDevice.java')
-rw-r--r--core/java/android/bluetooth/BluetoothDevice.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/core/java/android/bluetooth/BluetoothDevice.java b/core/java/android/bluetooth/BluetoothDevice.java
index 41bc77651db6..c30b8af3da53 100644
--- a/core/java/android/bluetooth/BluetoothDevice.java
+++ b/core/java/android/bluetooth/BluetoothDevice.java
@@ -1002,6 +1002,24 @@ public final class BluetoothDevice implements Parcelable {
public static final String EXTRA_MAS_INSTANCE =
"android.bluetooth.device.extra.MAS_INSTANCE";
+ /** @hide */
+ @Retention(RetentionPolicy.SOURCE)
+ @IntDef(
+ prefix = { "ADDRESS_TYPE_" },
+ value = {
+ /** Hardware MAC Address */
+ ADDRESS_TYPE_PUBLIC,
+ /** Address is either resolvable, non-resolvable or static.*/
+ ADDRESS_TYPE_RANDOM,
+ }
+ )
+ public @interface AddressType {}
+
+ /** Hardware MAC Address of the device */
+ public static final int ADDRESS_TYPE_PUBLIC = 0;
+ /** Address is either resolvable, non-resolvable or static. */
+ public static final int ADDRESS_TYPE_RANDOM = 1;
+
/**
* Lazy initialization. Guaranteed final after first object constructed, or
* getService() called.
@@ -1010,6 +1028,7 @@ public final class BluetoothDevice implements Parcelable {
private static volatile IBluetooth sService;
private final String mAddress;
+ @AddressType private final int mAddressType;
/*package*/
@UnsupportedAppUsage
@@ -1064,6 +1083,7 @@ public final class BluetoothDevice implements Parcelable {
}
mAddress = address;
+ mAddressType = ADDRESS_TYPE_PUBLIC;
}
@Override