mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 03:09:04 +01:00
Advertise the Bluetooth address if the device is discoverable.
This commit is contained in:
@@ -146,11 +146,14 @@ class BluetoothPlugin extends AbstractPlugin implements StreamPlugin {
|
||||
// Try to make the device discoverable (requires root on Linux)
|
||||
try {
|
||||
localDevice.setDiscoverable(DiscoveryAgent.GIAC);
|
||||
} catch(BluetoothStateException e) {
|
||||
if(LOG.isLoggable(Level.WARNING)) LOG.warning(e.getMessage());
|
||||
}
|
||||
// Advertise the address to contacts if the device is discoverable
|
||||
if(localDevice.getDiscoverable() == 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());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user