mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 18:59:06 +01:00
Don't store the local address unless the device is discoverable.
This commit is contained in:
@@ -120,7 +120,6 @@ class BluetoothPlugin extends AbstractPlugin implements StreamPlugin {
|
||||
return;
|
||||
}
|
||||
socket = scn;
|
||||
setLocalBluetoothAddress(localDevice.getBluetoothAddress());
|
||||
}
|
||||
startContactAccepterThread();
|
||||
}
|
||||
@@ -145,18 +144,14 @@ class BluetoothPlugin extends AbstractPlugin implements StreamPlugin {
|
||||
// Try to make the device discoverable (requires root on Linux)
|
||||
try {
|
||||
localDevice.setDiscoverable(DiscoveryAgent.GIAC);
|
||||
TransportProperties p = callback.getLocalProperties();
|
||||
p.put("address", localDevice.getBluetoothAddress());
|
||||
callback.setLocalProperties(p);
|
||||
} catch(BluetoothStateException e) {
|
||||
if(LOG.isLoggable(Level.WARNING)) LOG.warning(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private synchronized void setLocalBluetoothAddress(String address) {
|
||||
assert started;
|
||||
TransportProperties p = callback.getLocalProperties();
|
||||
p.put("address", address);
|
||||
callback.setLocalProperties(p);
|
||||
}
|
||||
|
||||
private void startContactAccepterThread() {
|
||||
new Thread() {
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user