mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-21 07:09:56 +01:00
Don't try to add extra UUIDs to emptyList().
This commit is contained in:
@@ -342,20 +342,18 @@ class AndroidBluetoothPlugin extends BluetoothPlugin<BluetoothServerSocket> {
|
|||||||
BluetoothDevice d = requireNonNull(
|
BluetoothDevice d = requireNonNull(
|
||||||
i.getParcelableExtra(EXTRA_DEVICE));
|
i.getParcelableExtra(EXTRA_DEVICE));
|
||||||
List<String> uuids = getUuids(d);
|
List<String> uuids = getUuids(d);
|
||||||
if (LOG.isLoggable(INFO)) {
|
|
||||||
LOG.info("Fetched " + uuids.size() + " UUIDs for "
|
|
||||||
+ scrubMacAddress(d.getAddress()));
|
|
||||||
}
|
|
||||||
// TODO: Test whether EXTRA_UUID is redundant on all devices
|
|
||||||
Parcelable[] extra = i.getParcelableArrayExtra(EXTRA_UUID);
|
Parcelable[] extra = i.getParcelableArrayExtra(EXTRA_UUID);
|
||||||
if (extra != null) {
|
if (extra != null) {
|
||||||
for (Parcelable p : extra) {
|
for (Parcelable p : extra) {
|
||||||
if (!uuids.contains(p.toString())) {
|
if (!uuids.contains(p.toString())) {
|
||||||
LOG.info("Extra UUID: " + p);
|
|
||||||
uuids.add(p.toString());
|
uuids.add(p.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (LOG.isLoggable(INFO)) {
|
||||||
|
LOG.info("Fetched " + uuids.size() + " UUIDs for "
|
||||||
|
+ scrubMacAddress(d.getAddress()));
|
||||||
|
}
|
||||||
for (String uuid : uuids) {
|
for (String uuid : uuids) {
|
||||||
Pair<TransportProperties, DiscoveryHandler> pair =
|
Pair<TransportProperties, DiscoveryHandler> pair =
|
||||||
byUuid.remove(uuid);
|
byUuid.remove(uuid);
|
||||||
@@ -400,7 +398,7 @@ class AndroidBluetoothPlugin extends BluetoothPlugin<BluetoothServerSocket> {
|
|||||||
|
|
||||||
private List<String> getUuids(BluetoothDevice d) {
|
private List<String> getUuids(BluetoothDevice d) {
|
||||||
ParcelUuid[] uuids = d.getUuids();
|
ParcelUuid[] uuids = d.getUuids();
|
||||||
if (uuids == null) return emptyList();
|
if (uuids == null) return new ArrayList<>();
|
||||||
List<String> strings = new ArrayList<>(uuids.length);
|
List<String> strings = new ArrayList<>(uuids.length);
|
||||||
for (ParcelUuid u : uuids) strings.add(u.toString());
|
for (ParcelUuid u : uuids) strings.add(u.toString());
|
||||||
return strings;
|
return strings;
|
||||||
|
|||||||
Reference in New Issue
Block a user