@Override public void stop() { if (server != null && server.isAlive()) { server.close(); setConnected(false); /* if (receiver != null) { context.unregisterReceiver(receiver); receiver = null; } */ } else { Log.i(TAG, "Attempting to stop Bluetooth swap, but it is not currently running."); } }
@Override public boolean isConnected() { return server != null && server.isRunning() && super.isConnected(); }