From 4cf92a2568582b42e9c5a07f15986d1505278576 Mon Sep 17 00:00:00 2001
From: akwizgran <akwizgran@users.sourceforge.net>
Date: Fri, 24 Aug 2012 12:24:50 +0100
Subject: [PATCH] Use the same method as Android for calculating Bluetooth
 UUIDs.

---
 .../briar/plugins/bluetooth/BluetoothClientTest.java  |  2 +-
 .../briar/plugins/bluetooth/BluetoothServerTest.java  |  2 +-
 .../net/sf/briar/plugins/bluetooth/BluetoothTest.java | 11 +++++++++--
 3 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/test/net/sf/briar/plugins/bluetooth/BluetoothClientTest.java b/test/net/sf/briar/plugins/bluetooth/BluetoothClientTest.java
index 51a85f7f0e..96ee30ca24 100644
--- a/test/net/sf/briar/plugins/bluetooth/BluetoothClientTest.java
+++ b/test/net/sf/briar/plugins/bluetooth/BluetoothClientTest.java
@@ -19,7 +19,7 @@ public class BluetoothClientTest extends DuplexClientTest {
 		// Store the server's Bluetooth address and UUID
 		TransportProperties p = new TransportProperties();
 		p.put("address", serverAddress);
-		p.put("uuid", BluetoothTest.UUID);
+		p.put("uuid", BluetoothTest.getUuid());
 		Map<ContactId, TransportProperties> remote =
 			Collections.singletonMap(contactId, p);
 		// Create the plugin
diff --git a/test/net/sf/briar/plugins/bluetooth/BluetoothServerTest.java b/test/net/sf/briar/plugins/bluetooth/BluetoothServerTest.java
index 9a492f37fe..b818d05e73 100644
--- a/test/net/sf/briar/plugins/bluetooth/BluetoothServerTest.java
+++ b/test/net/sf/briar/plugins/bluetooth/BluetoothServerTest.java
@@ -16,7 +16,7 @@ public class BluetoothServerTest extends DuplexServerTest {
 	private BluetoothServerTest(Executor executor) {
 		// Store the UUID
 		TransportProperties local = new TransportProperties();
-		local.put("uuid", BluetoothTest.UUID);
+		local.put("uuid", BluetoothTest.getUuid());
 		// Create the plugin
 		callback = new ServerCallback(new TransportConfig(), local,
 				Collections.singletonMap(contactId, new TransportProperties()));
diff --git a/test/net/sf/briar/plugins/bluetooth/BluetoothTest.java b/test/net/sf/briar/plugins/bluetooth/BluetoothTest.java
index b67c4b3c4f..17676bb08b 100644
--- a/test/net/sf/briar/plugins/bluetooth/BluetoothTest.java
+++ b/test/net/sf/briar/plugins/bluetooth/BluetoothTest.java
@@ -1,6 +1,13 @@
 package net.sf.briar.plugins.bluetooth;
 
-interface BluetoothTest {
+import java.util.UUID;
 
-	static final String UUID = "CABBA6E5CABBA6E5CABBA6E5CABBA6E5";
+class BluetoothTest {
+
+	private static final String EMPTY_UUID =
+			UUID.nameUUIDFromBytes(new byte[0]).toString().replaceAll("-", "");
+
+	static String getUuid() {
+		return EMPTY_UUID;
+	}
 }
\ No newline at end of file
-- 
GitLab