mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-15 04:18:53 +01:00
Don't try to make multiple Bluetooth connections on Motorola devices.
This commit is contained in:
@@ -22,6 +22,8 @@ public abstract class AbstractDuplexTransportConnection
|
||||
private final Writer writer;
|
||||
private final AtomicBoolean halfClosed, closed;
|
||||
|
||||
private volatile boolean markedForClose = false;
|
||||
|
||||
protected AbstractDuplexTransportConnection(Plugin plugin) {
|
||||
this.plugin = plugin;
|
||||
reader = new Reader();
|
||||
@@ -52,6 +54,16 @@ public abstract class AbstractDuplexTransportConnection
|
||||
return remote;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isMarkedForClose() {
|
||||
return markedForClose;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void markForClose() {
|
||||
markedForClose = true;
|
||||
}
|
||||
|
||||
private class Reader implements TransportConnectionReader {
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.briarproject.bramble.api.plugin.duplex;
|
||||
|
||||
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
|
||||
import org.briarproject.bramble.api.plugin.ConnectionHandler;
|
||||
import org.briarproject.bramble.api.plugin.TransportConnectionReader;
|
||||
import org.briarproject.bramble.api.plugin.TransportConnectionWriter;
|
||||
import org.briarproject.bramble.api.properties.TransportProperties;
|
||||
@@ -30,4 +31,17 @@ public interface DuplexTransportConnection {
|
||||
* the remote peer.
|
||||
*/
|
||||
TransportProperties getRemoteProperties();
|
||||
|
||||
/**
|
||||
* Returns true if the connection should be closed immediately without
|
||||
* sending anything.
|
||||
*/
|
||||
boolean isMarkedForClose();
|
||||
|
||||
/**
|
||||
* Call this method before the connection is passed to its
|
||||
* {@link ConnectionHandler} if the connection should be closed immediately
|
||||
* without sending anything.
|
||||
*/
|
||||
void markForClose();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user