Share via


CompanionDeviceManager.RemoveBond(Int32) Method

Definition

Remove bonding between this device and an associated companion device.

[Android.Runtime.Register("removeBond", "(I)Z", "", ApiSince=36)]
[Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")]
public bool RemoveBond(int associationId);
[<Android.Runtime.Register("removeBond", "(I)Z", "", ApiSince=36)>]
[<Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")>]
member this.RemoveBond : int -> bool

Parameters

associationId
Int32

an already-associated companion device to remove bond from

Returns

false on immediate error, true if bond removal process will begin

Attributes

Remarks

Remove bonding between this device and an associated companion device.

This is an asynchronous call, it will return immediately. Register for BluetoothDevice#ACTION_BOND_STATE_CHANGED intents to be notified when the bond removal process completes, and its result.

This API should be used to remove a bluetooth bond that was created either by using BluetoothDevice#createBond(int) or by a direct user action. The association must already exist with this device before calling this method, but this may be done retroactively to remove a bond that was created outside of the CompanionDeviceManager.

Java documentation for android.companion.CompanionDeviceManager.removeBond(int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to