Chromium Code Reviews| Index: device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothAdapter.java | 
| diff --git a/device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothAdapter.java b/device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothAdapter.java | 
| index d487ad9805b7b1ff7f862bf21725a7bea8b099af..683de40ea8ece0091db574b8f141aac1bd61468a 100644 | 
| --- a/device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothAdapter.java | 
| +++ b/device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothAdapter.java | 
| @@ -19,7 +19,6 @@ import org.chromium.base.annotations.CalledByNative; | 
| import org.chromium.base.annotations.JNINamespace; | 
| import org.chromium.components.location.LocationUtils; | 
| -import java.util.HashSet; | 
| import java.util.List; | 
| /** | 
| @@ -243,18 +242,20 @@ final class ChromeBluetoothAdapter extends BroadcastReceiver { | 
| Log.v(TAG, "onScanResult %d %s %s", callbackType, result.getDevice().getAddress(), | 
| result.getDevice().getName()); | 
| - HashSet<String> uuid_strings = new HashSet<>(); | 
| + String[] uuid_strings; | 
| 
 
Jeffrey Yasskin
2016/08/18 16:04:32
Was this just an improvement you happened to notic
 
ortuno
2016/08/19 20:50:32
Before we were putting UUIDs in a set since the c+
 
Jeffrey Yasskin
2016/08/19 22:08:09
... because there might be duplicates in the UUIDs
 
ortuno
2016/08/23 00:38:04
Oh, mainly because users of GetUUIDs used it to ch
 
 | 
| List<ParcelUuid> uuids = result.getScanRecord_getServiceUuids(); | 
| - if (uuids != null) { | 
| - for (ParcelUuid uuid : uuids) { | 
| - uuid_strings.add(uuid.toString()); | 
| + if (uuids == null) { | 
| + uuid_strings = new String[] {}; | 
| + } else { | 
| + uuid_strings = new String[uuids.size()]; | 
| + for (int i = 0; i < uuids.size(); i++) { | 
| + uuid_strings[i] = uuids.get(i).toString(); | 
| } | 
| } | 
| nativeCreateOrUpdateDeviceOnScan(mNativeBluetoothAdapterAndroid, | 
| - result.getDevice().getAddress(), result.getDevice(), | 
| - uuid_strings.toArray(new String[uuid_strings.size()])); | 
| + result.getDevice().getAddress(), result.getDevice(), uuid_strings); | 
| } | 
| @Override |