I would like to be able to press a button in an app and bond with a BLE device. Next time I open the app and reconect the BLE device I would like to see if it is already bonded and hide the button. Unfortuntely the ObservableBleManager bondingState is incorrectly reported as NOT_BONDED when it actually is bonded. android.bluetooth.BluetoothDevice shows it as being bonded.
To Reproduce
- Connect to a BLE device
- Call
ensureBond().enqueue()
- Disconnect BLE device
- Close and re-open app
- Connect BLE device
BondState is NOT_BONDED but bluetoothDevice.bondState == BluetoothDevice.BOND_BONDED the Android OS reports it as bonded also.
Notes
After bonding for the first time, BondState is correct. BondState is also correct if I remove bond and ensure bond again.
I would like to be able to press a button in an app and bond with a BLE device. Next time I open the app and reconect the BLE device I would like to see if it is already bonded and hide the button. Unfortuntely the
ObservableBleManagerbondingStateis incorrectly reported asNOT_BONDEDwhen it actually is bonded.android.bluetooth.BluetoothDeviceshows it as being bonded.To Reproduce
ensureBond().enqueue()BondStateisNOT_BONDEDbutbluetoothDevice.bondState == BluetoothDevice.BOND_BONDEDthe Android OS reports it as bonded also.Notes
After bonding for the first time,
BondStateis correct.BondStateis also correct if I remove bond and ensure bond again.