Loading core/api/system-current.txt +49 −0 Original line number Diff line number Diff line Loading @@ -1888,6 +1888,7 @@ package android.bluetooth { public final class BluetoothDevice implements android.os.Parcelable { method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean canBondWithoutDialog(); method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean cancelBondProcess(); method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean createBondOutOfBand(int, @Nullable android.bluetooth.OobData, @Nullable android.bluetooth.OobData); method @Nullable @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public byte[] getMetadata(int); method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public int getSimAccessPermission(); method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public boolean isConnected(); Loading Loading @@ -2064,6 +2065,54 @@ package android.bluetooth { field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.BufferConstraints> CREATOR; } public final class OobData implements android.os.Parcelable { method @NonNull public static android.bluetooth.OobData.ClassicBuilder createClassicBuilder(@NonNull byte[], @NonNull byte[], @NonNull byte[]); method @NonNull public static android.bluetooth.OobData.LeBuilder createLeBuilder(@NonNull byte[], @NonNull byte[], int); method @NonNull public byte[] getClassOfDevice(); method @NonNull public byte[] getClassicLength(); method @NonNull public byte[] getConfirmationHash(); method @NonNull public byte[] getDeviceAddressWithType(); method @Nullable public byte[] getDeviceName(); method @Nullable public byte[] getLeAppearance(); method @NonNull public int getLeDeviceRole(); method @NonNull public int getLeFlags(); method @Nullable public byte[] getLeTemporaryKey(); method @NonNull public byte[] getRandomizerHash(); field public static final int CLASS_OF_DEVICE_OCTETS = 3; // 0x3 field public static final int CONFIRMATION_OCTETS = 16; // 0x10 field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.OobData> CREATOR; field public static final int DEVICE_ADDRESS_OCTETS = 7; // 0x7 field public static final int LE_APPEARANCE_OCTETS = 2; // 0x2 field public static final int LE_DEVICE_FLAG_OCTETS = 1; // 0x1 field public static final int LE_DEVICE_ROLE_BOTH_PREFER_CENTRAL = 3; // 0x3 field public static final int LE_DEVICE_ROLE_BOTH_PREFER_PERIPHERAL = 2; // 0x2 field public static final int LE_DEVICE_ROLE_CENTRAL_ONLY = 1; // 0x1 field public static final int LE_DEVICE_ROLE_OCTETS = 1; // 0x1 field public static final int LE_DEVICE_ROLE_PERIPHERAL_ONLY = 0; // 0x0 field public static final int LE_FLAG_BREDR_NOT_SUPPORTED = 2; // 0x2 field public static final int LE_FLAG_GENERAL_DISCOVERY_MODE = 1; // 0x1 field public static final int LE_FLAG_LIMITED_DISCOVERY_MODE = 0; // 0x0 field public static final int LE_FLAG_SIMULTANEOUS_CONTROLLER = 3; // 0x3 field public static final int LE_FLAG_SIMULTANEOUS_HOST = 4; // 0x4 field public static final int LE_TK_OCTETS = 16; // 0x10 field public static final int RANDOMIZER_OCTETS = 16; // 0x10 } public static final class OobData.ClassicBuilder { method @NonNull public android.bluetooth.OobData build(); method @NonNull public android.bluetooth.OobData.ClassicBuilder setClassOfDevice(@NonNull byte[]); method @NonNull public android.bluetooth.OobData.ClassicBuilder setDeviceName(@NonNull byte[]); method @NonNull public android.bluetooth.OobData.ClassicBuilder setRandomizerHash(@NonNull byte[]); } public static final class OobData.LeBuilder { method @NonNull public android.bluetooth.OobData build(); method @NonNull public android.bluetooth.OobData.LeBuilder setDeviceName(@NonNull byte[]); method @NonNull public android.bluetooth.OobData.LeBuilder setLeFlags(int); method @NonNull public android.bluetooth.OobData.LeBuilder setLeTemporaryKey(@NonNull byte[]); method @NonNull public android.bluetooth.OobData.LeBuilder setRandomizerHash(@NonNull byte[]); } } package android.bluetooth.le { Loading core/java/android/bluetooth/BluetoothDevice.java +24 −28 Original line number Diff line number Diff line Loading @@ -1311,7 +1311,6 @@ public final class BluetoothDevice implements Parcelable { * the bonding process completes, and its result. * <p>Android system services will handle the necessary user interactions * to confirm and complete the bonding process. * <p>Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN}. * * @param transport The transport to use for the pairing procedure. * @return false on immediate error, true if bonding will begin Loading @@ -1319,8 +1318,9 @@ public final class BluetoothDevice implements Parcelable { * @hide */ @UnsupportedAppUsage @RequiresPermission(Manifest.permission.BLUETOOTH_ADMIN) public boolean createBond(int transport) { return createBondOutOfBand(transport, null); return createBondInternal(transport, null, null); } /** Loading @@ -1334,22 +1334,39 @@ public final class BluetoothDevice implements Parcelable { * <p>Android system services will handle the necessary user interactions * to confirm and complete the bonding process. * * <p>Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN}. * <p>There are two possible versions of OOB Data. This data can come in as * P192 or P256. This is a reference to the cryptography used to generate the key. * The caller may pass one or both. If both types of data are passed, then the * P256 data will be preferred, and thus used. * * @param transport - Transport to use * @param oobData - Out Of Band data * @param remoteP192Data - Out Of Band data (P192) or null * @param remoteP256Data - Out Of Band data (P256) or null * @return false on immediate error, true if bonding will begin * @hide */ public boolean createBondOutOfBand(int transport, OobData oobData) { @SystemApi @RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean createBondOutOfBand(int transport, @Nullable OobData remoteP192Data, @Nullable OobData remoteP256Data) { if (remoteP192Data == null && remoteP256Data == null) { throw new IllegalArgumentException( "One or both arguments for the OOB data types are required to not be null." + " Please use createBond() instead if you do not have OOB data to pass."); } return createBondInternal(transport, remoteP192Data, remoteP256Data); } private boolean createBondInternal(int transport, @Nullable OobData remoteP192Data, @Nullable OobData remoteP256Data) { final IBluetooth service = sService; if (service == null) { Log.w(TAG, "BT not enabled, createBondOutOfBand failed"); return false; } try { BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter(); return service.createBond(this, transport, oobData, adapter.getOpPackageName()); return service.createBond(this, transport, remoteP192Data, remoteP256Data, BluetoothAdapter.getDefaultAdapter().getOpPackageName()); } catch (RemoteException e) { Log.e(TAG, "", e); } Loading Loading @@ -1379,27 +1396,6 @@ public final class BluetoothDevice implements Parcelable { return false; } /** * Set the Out Of Band data for a remote device to be used later * in the pairing mechanism. Users can obtain this data through other * trusted channels * * <p>Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN}. * * @param hash Simple Secure pairing hash * @param randomizer The random key obtained using OOB * @return false on error; true otherwise * @hide */ public boolean setDeviceOutOfBandData(byte[] hash, byte[] randomizer) { //TODO(BT) /* try { return sService.setDeviceOutOfBandData(this, hash, randomizer); } catch (RemoteException e) {Log.e(TAG, "", e);} */ return false; } /** * Cancel an in-progress bonding request started with {@link #createBond}. * Loading core/java/android/bluetooth/OobData.java +944 −39 File changed.Preview size limit exceeded, changes collapsed. Show changes Loading
core/api/system-current.txt +49 −0 Original line number Diff line number Diff line Loading @@ -1888,6 +1888,7 @@ package android.bluetooth { public final class BluetoothDevice implements android.os.Parcelable { method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean canBondWithoutDialog(); method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean cancelBondProcess(); method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean createBondOutOfBand(int, @Nullable android.bluetooth.OobData, @Nullable android.bluetooth.OobData); method @Nullable @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public byte[] getMetadata(int); method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public int getSimAccessPermission(); method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public boolean isConnected(); Loading Loading @@ -2064,6 +2065,54 @@ package android.bluetooth { field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.BufferConstraints> CREATOR; } public final class OobData implements android.os.Parcelable { method @NonNull public static android.bluetooth.OobData.ClassicBuilder createClassicBuilder(@NonNull byte[], @NonNull byte[], @NonNull byte[]); method @NonNull public static android.bluetooth.OobData.LeBuilder createLeBuilder(@NonNull byte[], @NonNull byte[], int); method @NonNull public byte[] getClassOfDevice(); method @NonNull public byte[] getClassicLength(); method @NonNull public byte[] getConfirmationHash(); method @NonNull public byte[] getDeviceAddressWithType(); method @Nullable public byte[] getDeviceName(); method @Nullable public byte[] getLeAppearance(); method @NonNull public int getLeDeviceRole(); method @NonNull public int getLeFlags(); method @Nullable public byte[] getLeTemporaryKey(); method @NonNull public byte[] getRandomizerHash(); field public static final int CLASS_OF_DEVICE_OCTETS = 3; // 0x3 field public static final int CONFIRMATION_OCTETS = 16; // 0x10 field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.OobData> CREATOR; field public static final int DEVICE_ADDRESS_OCTETS = 7; // 0x7 field public static final int LE_APPEARANCE_OCTETS = 2; // 0x2 field public static final int LE_DEVICE_FLAG_OCTETS = 1; // 0x1 field public static final int LE_DEVICE_ROLE_BOTH_PREFER_CENTRAL = 3; // 0x3 field public static final int LE_DEVICE_ROLE_BOTH_PREFER_PERIPHERAL = 2; // 0x2 field public static final int LE_DEVICE_ROLE_CENTRAL_ONLY = 1; // 0x1 field public static final int LE_DEVICE_ROLE_OCTETS = 1; // 0x1 field public static final int LE_DEVICE_ROLE_PERIPHERAL_ONLY = 0; // 0x0 field public static final int LE_FLAG_BREDR_NOT_SUPPORTED = 2; // 0x2 field public static final int LE_FLAG_GENERAL_DISCOVERY_MODE = 1; // 0x1 field public static final int LE_FLAG_LIMITED_DISCOVERY_MODE = 0; // 0x0 field public static final int LE_FLAG_SIMULTANEOUS_CONTROLLER = 3; // 0x3 field public static final int LE_FLAG_SIMULTANEOUS_HOST = 4; // 0x4 field public static final int LE_TK_OCTETS = 16; // 0x10 field public static final int RANDOMIZER_OCTETS = 16; // 0x10 } public static final class OobData.ClassicBuilder { method @NonNull public android.bluetooth.OobData build(); method @NonNull public android.bluetooth.OobData.ClassicBuilder setClassOfDevice(@NonNull byte[]); method @NonNull public android.bluetooth.OobData.ClassicBuilder setDeviceName(@NonNull byte[]); method @NonNull public android.bluetooth.OobData.ClassicBuilder setRandomizerHash(@NonNull byte[]); } public static final class OobData.LeBuilder { method @NonNull public android.bluetooth.OobData build(); method @NonNull public android.bluetooth.OobData.LeBuilder setDeviceName(@NonNull byte[]); method @NonNull public android.bluetooth.OobData.LeBuilder setLeFlags(int); method @NonNull public android.bluetooth.OobData.LeBuilder setLeTemporaryKey(@NonNull byte[]); method @NonNull public android.bluetooth.OobData.LeBuilder setRandomizerHash(@NonNull byte[]); } } package android.bluetooth.le { Loading
core/java/android/bluetooth/BluetoothDevice.java +24 −28 Original line number Diff line number Diff line Loading @@ -1311,7 +1311,6 @@ public final class BluetoothDevice implements Parcelable { * the bonding process completes, and its result. * <p>Android system services will handle the necessary user interactions * to confirm and complete the bonding process. * <p>Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN}. * * @param transport The transport to use for the pairing procedure. * @return false on immediate error, true if bonding will begin Loading @@ -1319,8 +1318,9 @@ public final class BluetoothDevice implements Parcelable { * @hide */ @UnsupportedAppUsage @RequiresPermission(Manifest.permission.BLUETOOTH_ADMIN) public boolean createBond(int transport) { return createBondOutOfBand(transport, null); return createBondInternal(transport, null, null); } /** Loading @@ -1334,22 +1334,39 @@ public final class BluetoothDevice implements Parcelable { * <p>Android system services will handle the necessary user interactions * to confirm and complete the bonding process. * * <p>Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN}. * <p>There are two possible versions of OOB Data. This data can come in as * P192 or P256. This is a reference to the cryptography used to generate the key. * The caller may pass one or both. If both types of data are passed, then the * P256 data will be preferred, and thus used. * * @param transport - Transport to use * @param oobData - Out Of Band data * @param remoteP192Data - Out Of Band data (P192) or null * @param remoteP256Data - Out Of Band data (P256) or null * @return false on immediate error, true if bonding will begin * @hide */ public boolean createBondOutOfBand(int transport, OobData oobData) { @SystemApi @RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean createBondOutOfBand(int transport, @Nullable OobData remoteP192Data, @Nullable OobData remoteP256Data) { if (remoteP192Data == null && remoteP256Data == null) { throw new IllegalArgumentException( "One or both arguments for the OOB data types are required to not be null." + " Please use createBond() instead if you do not have OOB data to pass."); } return createBondInternal(transport, remoteP192Data, remoteP256Data); } private boolean createBondInternal(int transport, @Nullable OobData remoteP192Data, @Nullable OobData remoteP256Data) { final IBluetooth service = sService; if (service == null) { Log.w(TAG, "BT not enabled, createBondOutOfBand failed"); return false; } try { BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter(); return service.createBond(this, transport, oobData, adapter.getOpPackageName()); return service.createBond(this, transport, remoteP192Data, remoteP256Data, BluetoothAdapter.getDefaultAdapter().getOpPackageName()); } catch (RemoteException e) { Log.e(TAG, "", e); } Loading Loading @@ -1379,27 +1396,6 @@ public final class BluetoothDevice implements Parcelable { return false; } /** * Set the Out Of Band data for a remote device to be used later * in the pairing mechanism. Users can obtain this data through other * trusted channels * * <p>Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN}. * * @param hash Simple Secure pairing hash * @param randomizer The random key obtained using OOB * @return false on error; true otherwise * @hide */ public boolean setDeviceOutOfBandData(byte[] hash, byte[] randomizer) { //TODO(BT) /* try { return sService.setDeviceOutOfBandData(this, hash, randomizer); } catch (RemoteException e) {Log.e(TAG, "", e);} */ return false; } /** * Cancel an in-progress bonding request started with {@link #createBond}. * Loading
core/java/android/bluetooth/OobData.java +944 −39 File changed.Preview size limit exceeded, changes collapsed. Show changes