Close server socket when BT is disabled.

This commit is contained in:
akwizgran
2020-01-17 12:38:03 +00:00
parent 0a5f93edf9
commit 2b9ffc7fbe

View File

@@ -133,6 +133,8 @@ abstract class BluetoothPlugin<SS> implements DuplexPlugin, EventListener {
void onAdapterDisabled() {
LOG.info("Bluetooth disabled");
connectionLimiter.allConnectionsClosed();
// The server socket may not have been closed automatically
tryToClose(state.clearServerSocket());
callback.pluginStateChanged(getState());
}