diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2021-03-22 03:15:47 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-03-22 03:15:47 +0000 |
commit | 1cac38b565e62b93484c6aba6fb6c5cd6fd931cc (patch) | |
tree | 13c5799168ab5ece237f43ba2f99f970f5631d2a /framework/java/android/bluetooth/BluetoothDevice.java | |
parent | 91ef442293e9be65e9597da504c18fcb9539c0fc (diff) | |
parent | 2c15f0cbf345fae5e5b5826a32665074f1e6d289 (diff) |
Merge "Add new @SystemApi for specifying AddressType and IRK" am: 2c15f0cbf3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1641559
Change-Id: I616502ee58d95cbc20fd38b395f7f0e294b5713e
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothDevice.java')
-rw-r--r-- | framework/java/android/bluetooth/BluetoothDevice.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/framework/java/android/bluetooth/BluetoothDevice.java b/framework/java/android/bluetooth/BluetoothDevice.java index 41bc77651d..c30b8af3da 100644 --- a/framework/java/android/bluetooth/BluetoothDevice.java +++ b/framework/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 |