Disconnect all devices that are not NOT_CONNECTED

Disconnect devices in all states except GBDevice.State.NOT_CONNECTED.
This should fix devices getting stuck in GBDevice.State.CONNECTING state
when Bluetooth is switched off.
This commit is contained in:
Davis Mosenkovs
2024-01-08 17:11:33 +00:00
committed by José Rebelo
parent 9e10da062e
commit 5bcebe9590
@@ -598,6 +598,8 @@ public class DeviceCommunicationService extends Service implements SharedPrefere
} }
notifCache.removeAll(toRemove); notifCache.removeAll(toRemove);
} }
} else if (action.equals(ACTION_DISCONNECT) && device.getState() != GBDevice.State.NOT_CONNECTED) {
targetedDevices.add(device);
} }
} }
} }