Skip to content

Commit

Permalink
Fix removeBond reflection code
Browse files Browse the repository at this point in the history
  • Loading branch information
weliem committed Jan 21, 2022
1 parent 68faddc commit 38fe652
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -778,9 +778,8 @@ class BluetoothCentralManager(private val context: Context) {
// Try to remove the bond
return if (peripheralToUnBond != null) {
try {
// TODO FIX THIS, automatic conversion gone wrong
val method = peripheralToUnBond.javaClass.getMethod("removeBond", null)
val result = method.invoke(peripheralToUnBond, null as Array<Any?>?) as Boolean
val method = peripheralToUnBond.javaClass.getMethod("removeBond")
val result = method.invoke(peripheralToUnBond) as Boolean
if (result) {
Logger.i(TAG, "Succesfully removed bond for '%s'", peripheralToUnBond.name)
}
Expand Down

0 comments on commit 38fe652

Please sign in to comment.