Skip to content
Snippets Groups Projects
Commit d2e1500a authored by akwizgran's avatar akwizgran
Browse files

Store the UUID in the local properties so it gets sent to contacts.

parent 70c5d7ce
No related branches found
No related tags found
No related merge requests found
......@@ -18,7 +18,6 @@ import javax.microedition.io.StreamConnection;
import javax.microedition.io.StreamConnectionNotifier;
import net.sf.briar.api.ContactId;
import net.sf.briar.api.TransportConfig;
import net.sf.briar.api.TransportId;
import net.sf.briar.api.TransportProperties;
import net.sf.briar.api.plugins.StreamPlugin;
......@@ -126,15 +125,15 @@ class BluetoothPlugin extends AbstractPlugin implements StreamPlugin {
private synchronized String getUuid() {
assert started;
TransportConfig c = callback.getConfig();
String uuid = c.get("uuid");
TransportProperties p = callback.getLocalProperties();
String uuid = p.get("uuid");
if(uuid == null) {
// Generate a (weakly) random UUID and store it
byte[] b = new byte[16];
new Random().nextBytes(b);
uuid = StringUtils.toHexString(b);
c.put("uuid", uuid);
callback.setConfig(c);
p.put("uuid", uuid);
callback.setLocalProperties(p);
}
return uuid;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment