summaryrefslogtreecommitdiff
path: root/framework/java/android/bluetooth/OobData.java
diff options
context:
space:
mode:
authorJakub Pawlowski <jpawlowski@google.com>2016-11-09 16:51:09 -0800
committerAndre Eisenbach <eisenbach@google.com>2016-11-10 19:51:49 +0000
commitac1c8d563d9441ca5315fef33e24c367a2aea2a0 (patch)
treebeaadbda2a6e7553eccf094d30f7466d124b7eba /framework/java/android/bluetooth/OobData.java
parentc829ce5d02d0d5c9d9feae8e533ff679c7e0f213 (diff)
BLE OOB Pairing - parse address type (5/5)
When address type is not parsed, creating bond to devices not using random address is impossible. Bug: 32780409 Test: try pairing with nRF52DK using random address Change-Id: Ie6cc1f8c008d43b2acd021b47f9bbfb1f63472e8
Diffstat (limited to 'framework/java/android/bluetooth/OobData.java')
-rw-r--r--framework/java/android/bluetooth/OobData.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/framework/java/android/bluetooth/OobData.java b/framework/java/android/bluetooth/OobData.java
index f53ca94a1d..9e87230c68 100644
--- a/framework/java/android/bluetooth/OobData.java
+++ b/framework/java/android/bluetooth/OobData.java
@@ -30,10 +30,24 @@ import android.util.Log;
* @hide
*/
public class OobData implements Parcelable {
+ private byte[] leBluetoothDeviceAddress;
private byte[] securityManagerTk;
private byte[] leSecureConnectionsConfirmation;
private byte[] leSecureConnectionsRandom;
+ public byte[] getLeBluetoothDeviceAddress() {
+ return leBluetoothDeviceAddress;
+ }
+
+ /**
+ * Sets the LE Bluetooth Device Address value to be used during LE pairing.
+ * The value shall be 7 bytes. Please see Bluetooth CSSv6, Part A 1.16 for
+ * a detailed description.
+ */
+ public void setLeBluetoothDeviceAddress(byte[] leBluetoothDeviceAddress) {
+ this.leBluetoothDeviceAddress = leBluetoothDeviceAddress;
+ }
+
public byte[] getSecurityManagerTk() {
return securityManagerTk;
}
@@ -66,6 +80,7 @@ public class OobData implements Parcelable {
public OobData() { }
private OobData(Parcel in) {
+ leBluetoothDeviceAddress = in.createByteArray();
securityManagerTk = in.createByteArray();
leSecureConnectionsConfirmation = in.createByteArray();
leSecureConnectionsRandom = in.createByteArray();
@@ -77,6 +92,7 @@ public class OobData implements Parcelable {
@Override
public void writeToParcel(Parcel out, int flags) {
+ out.writeByteArray(leBluetoothDeviceAddress);
out.writeByteArray(securityManagerTk);
out.writeByteArray(leSecureConnectionsConfirmation);
out.writeByteArray(leSecureConnectionsRandom);