mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-21 07:09:56 +01:00
Ignore case when comparing Bluetooth UUIDs.
This commit is contained in:
@@ -233,8 +233,6 @@ class BluetoothPlugin extends AbstractPlugin implements StreamPlugin {
|
|||||||
String address = p.get("address");
|
String address = p.get("address");
|
||||||
String uuid = p.get("uuid");
|
String uuid = p.get("uuid");
|
||||||
if(address != null && uuid != null) {
|
if(address != null && uuid != null) {
|
||||||
if(LOG.isLoggable(Level.FINE))
|
|
||||||
LOG.fine("Searching for " + uuid + " at " + address);
|
|
||||||
addresses.put(address, c);
|
addresses.put(address, c);
|
||||||
uuids.put(c, uuid);
|
uuids.put(c, uuid);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,8 +81,7 @@ class ContactListener implements DiscoveryListener {
|
|||||||
for(ServiceRecord record : services) {
|
for(ServiceRecord record : services) {
|
||||||
// Do we recognise the address?
|
// Do we recognise the address?
|
||||||
RemoteDevice device = record.getHostDevice();
|
RemoteDevice device = record.getHostDevice();
|
||||||
String address = device.getBluetoothAddress();
|
ContactId c = addresses.get(device.getBluetoothAddress());
|
||||||
ContactId c = addresses.get(address);
|
|
||||||
if(c == null) continue;
|
if(c == null) continue;
|
||||||
// Do we have a UUID for this contact?
|
// Do we have a UUID for this contact?
|
||||||
String uuid = uuids.get(c);
|
String uuid = uuids.get(c);
|
||||||
@@ -101,8 +100,6 @@ class ContactListener implements DiscoveryListener {
|
|||||||
UUID serviceUuid = (UUID) classId.getValue();
|
UUID serviceUuid = (UUID) classId.getValue();
|
||||||
if(uuid.equalsIgnoreCase(serviceUuid.toString())) {
|
if(uuid.equalsIgnoreCase(serviceUuid.toString())) {
|
||||||
// The UUID matches - store the URL
|
// The UUID matches - store the URL
|
||||||
if(LOG.isLoggable(Level.FINE))
|
|
||||||
LOG.fine("Discovered " + uuid + " at " + address);
|
|
||||||
urls.put(c, serviceUrl);
|
urls.put(c, serviceUrl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ class InvitationListener implements DiscoveryListener {
|
|||||||
(Enumeration<DataElement>) classIds.getValue();
|
(Enumeration<DataElement>) classIds.getValue();
|
||||||
for(DataElement classId : Collections.list(e)) {
|
for(DataElement classId : Collections.list(e)) {
|
||||||
UUID serviceUuid = (UUID) classId.getValue();
|
UUID serviceUuid = (UUID) classId.getValue();
|
||||||
if(uuid.equals(serviceUuid.toString())) {
|
if(uuid.equalsIgnoreCase(serviceUuid.toString())) {
|
||||||
// The UUID matches - store the URL
|
// The UUID matches - store the URL
|
||||||
synchronized(this) {
|
synchronized(this) {
|
||||||
url = serviceUrl;
|
url = serviceUrl;
|
||||||
|
|||||||
Reference in New Issue
Block a user