Skip to content

Commit 78ad90d

Browse files
authored
Merge pull request #620 from junebeans/gatt-stays-open-in-background
`connectGatt` is successful without previous gatt not being closed
2 parents 5d2abcd + 6ca4973 commit 78ad90d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ble/src/main/java/no/nordicsemi/android/ble/BleManagerHandler.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,9 @@ private boolean internalConnect(@NonNull final BluetoothDevice device,
697697
preferredPhy = connectRequest.getPreferredPhy();
698698
}
699699
final int finalPreferredPhy = preferredPhy;
700+
var gatt = bluetoothGatt;
701+
log(Log.DEBUG, () -> "gatt.close()");
702+
gatt.close();
700703
log(Log.DEBUG, () ->
701704
"gatt = device.connectGatt(autoConnect = true, TRANSPORT_LE, "
702705
+ ParserUtils.phyMaskToString(finalPreferredPhy) + ")");

0 commit comments

Comments
 (0)