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

Commit 7cbc1aee authored by Andre Eisenbach's avatar Andre Eisenbach Committed by android-build-merger
Browse files

Merge "Implementation of BluetoothDevice.createBondOutOfBand"

am: 026a5847

* commit '026a5847':
  Implementation of BluetoothDevice.createBondOutOfBand
parents d24eb54b 026a5847
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -6987,6 +6987,15 @@ package android.bluetooth {
    field public static final int TYPE_SCO = 2; // 0x2
  }
  public class OobData implements android.os.Parcelable {
    ctor public OobData();
    method public int describeContents();
    method public byte[] getSecurityManagerTk();
    method public void setSecurityManagerTk(byte[]);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.bluetooth.OobData> CREATOR;
  }
}
package android.bluetooth.le {
+9 −0
Original line number Diff line number Diff line
@@ -7208,6 +7208,15 @@ package android.bluetooth {
    field public static final int TYPE_SCO = 2; // 0x2
  }
  public class OobData implements android.os.Parcelable {
    ctor public OobData();
    method public int describeContents();
    method public byte[] getSecurityManagerTk();
    method public void setSecurityManagerTk(byte[]);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.bluetooth.OobData> CREATOR;
  }
}
package android.bluetooth.le {
+5 −7
Original line number Diff line number Diff line
@@ -879,18 +879,16 @@ public final class BluetoothDevice implements Parcelable {
     *
     * <p>Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN}.
     *
     * @param hash - Simple Secure pairing hash
     * @param randomizer - The random key obtained using OOB
     * @param transport - Transport to use
     * @param oobData - Out Of Band data
     * @return false on immediate error, true if bonding will begin
     *
     * @hide
     */
    public boolean createBondOutOfBand(byte[] hash, byte[] randomizer) {
        //TODO(BT)
        /*
    public boolean createBondOutOfBand(int transport, OobData oobData) {
        try {
            return sService.createBondOutOfBand(this, hash, randomizer);
        } catch (RemoteException e) {Log.e(TAG, "", e);}*/
            return sService.createBondOutOfBand(this, transport, oobData);
        } catch (RemoteException e) {Log.e(TAG, "", e);}
        return false;
    }

+2 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.bluetooth.IBluetoothCallback;
import android.bluetooth.IBluetoothStateChangeCallback;
import android.bluetooth.BluetoothActivityEnergyInfo;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.OobData;
import android.os.ParcelUuid;
import android.os.ParcelFileDescriptor;

@@ -56,6 +57,7 @@ interface IBluetooth

    BluetoothDevice[] getBondedDevices();
    boolean createBond(in BluetoothDevice device, in int transport);
    boolean createBondOutOfBand(in BluetoothDevice device, in int transport, in OobData oobData);
    boolean cancelBondProcess(in BluetoothDevice device);
    boolean removeBond(in BluetoothDevice device);
    int getBondState(in BluetoothDevice device);
+19 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2016 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.bluetooth;

parcelable OobData;
Loading