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

Commit 5bde7349 authored by Jakub Pawlowski's avatar Jakub Pawlowski Committed by Android (Google) Code Review
Browse files

Merge changes from topic 'ble_oob_sc_mr2' into nyc-mr2-dev

* changes:
  BLE OOB Pairing - parse address type (5/5)
  Fix Bluetooth OOB pairing not working for unseen devices
  Add LE Secure Connection data parsing (1/4)
parents cb9f281e 1d8f1954
Loading
Loading
Loading
Loading
+38 −0
Original line number Diff line number Diff line
@@ -30,7 +30,23 @@ 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;
@@ -45,10 +61,29 @@ public class OobData implements Parcelable {
        this.securityManagerTk = securityManagerTk;
    }

    public byte[] getLeSecureConnectionsConfirmation() {
        return leSecureConnectionsConfirmation;
    }

    public void setLeSecureConnectionsConfirmation(byte[] leSecureConnectionsConfirmation) {
        this.leSecureConnectionsConfirmation = leSecureConnectionsConfirmation;
    }

    public byte[] getLeSecureConnectionsRandom() {
        return leSecureConnectionsRandom;
    }

    public void setLeSecureConnectionsRandom(byte[] leSecureConnectionsRandom) {
        this.leSecureConnectionsRandom = leSecureConnectionsRandom;
    }

    public OobData() { }

    private OobData(Parcel in) {
        leBluetoothDeviceAddress = in.createByteArray();
        securityManagerTk = in.createByteArray();
        leSecureConnectionsConfirmation = in.createByteArray();
        leSecureConnectionsRandom = in.createByteArray();
    }

    public int describeContents() {
@@ -57,7 +92,10 @@ 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);
    }

    public static final Parcelable.Creator<OobData> CREATOR