mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-18 05:39:53 +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;
|
return;
|
||||||
}
|
}
|
||||||
socket = scn;
|
socket = scn;
|
||||||
setLocalBluetoothAddress(localDevice.getBluetoothAddress());
|
|
||||||
}
|
}
|
||||||
startContactAccepterThread();
|
startContactAccepterThread();
|
||||||
}
|
}
|
||||||
@@ -145,18 +144,14 @@ class BluetoothPlugin extends AbstractPlugin implements StreamPlugin {
|
|||||||
// Try to make the device discoverable (requires root on Linux)
|
// Try to make the device discoverable (requires root on Linux)
|
||||||
try {
|
try {
|
||||||
localDevice.setDiscoverable(DiscoveryAgent.GIAC);
|
localDevice.setDiscoverable(DiscoveryAgent.GIAC);
|
||||||
|
TransportProperties p = callback.getLocalProperties();
|
||||||
|
p.put("address", localDevice.getBluetoothAddress());
|
||||||
|
callback.setLocalProperties(p);
|
||||||
} catch(BluetoothStateException e) {
|
} catch(BluetoothStateException e) {
|
||||||
if(LOG.isLoggable(Level.WARNING)) LOG.warning(e.getMessage());
|
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() {
|
private void startContactAccepterThread() {
|
||||||
new Thread() {
|
new Thread() {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user