Is it possible to forget bluetooth device using MacroDroid

downloaderfan

New member
Hello,

As far as I know, in regards to bluetooth, MacroDroid has the following options:

Enable/Disable/Toggle Bluetooth
Connect/Disconnect specific bluetooth device

Well, I am looking for a way to not just disconnect a bluetooth device, but permanently unpair it. Meaning it should disappear from the bluetooth device list altogether. Is this possible?
 

sampleuserhere

Active member
It seems it's possible to forget a device programmatically.


The first code in OP works with Tasker Java Function.

Code:
   BluetoothAdapter bluetoothAdapter = BluetoothAdapter.DefaultAdapter;
        BluetoothDevice bluetoothDevice = bluetoothAdapter.GetRemoteDevice(address);
        var mi = bluetoothDevice.Class.GetMethod("removeBond", null);
        mi.Invoke(bluetoothDevice, null);

address is the mac address. Maybe the dev could add this?

Here's the screen record as a proof.

*Bluetooth is turned off by a macro, i have one to toggle the bt off when there isn't any connected device.
 
Last edited:
Top