Fix android cleanup after disconnection (#106)

This commit is contained in:
Rohit Sangwan
2024-12-05 12:55:49 +05:30
committed by GitHub
parent d39f4cd5d3
commit 7542de8242
@@ -715,6 +715,8 @@ class UniversalBlePlugin : UniversalBlePlatformChannel, BluetoothGattCallback(),
private fun cleanConnection(gatt: BluetoothGatt) {
knownGatts.remove(gatt)
gatt.disconnect()
gatt.close()
readResultFutureList.removeAll {
if (it.deviceId == gatt.device.address) {
it.result(Result.failure(DeviceDisconnectedError))