Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(194)

Unified Diff: device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothAdapter.java

Issue 2205693003: bluetooth: Replace old advertised uuids (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@my-origin
Patch Set: Improve comments Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothDevice.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ebc9dc659c0ac0ad0b0a92a6256210d4d11f984a..d487ad9805b7b1ff7f862bf21725a7bea8b099af 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,6 +19,7 @@ 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;
/**
@@ -242,10 +243,18 @@ 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<>();
List<ParcelUuid> uuids = result.getScanRecord_getServiceUuids();
+ if (uuids != null) {
+ for (ParcelUuid uuid : uuids) {
+ uuid_strings.add(uuid.toString());
+ }
+ }
+
nativeCreateOrUpdateDeviceOnScan(mNativeBluetoothAdapterAndroid,
- result.getDevice().getAddress(), result.getDevice(), uuids);
+ result.getDevice().getAddress(), result.getDevice(),
+ uuid_strings.toArray(new String[uuid_strings.size()]));
}
@Override
@@ -305,7 +314,7 @@ final class ChromeBluetoothAdapter extends BroadcastReceiver {
// Wrappers.BluetoothDeviceWrapper reference is not handled by jni_generator.py JavaToJni.
// http://crbug.com/505554
private native void nativeCreateOrUpdateDeviceOnScan(long nativeBluetoothAdapterAndroid,
- String address, Object bluetoothDeviceWrapper, List<ParcelUuid> advertisedUuids);
+ String address, Object bluetoothDeviceWrapper, String[] advertisedUuids);
// Binds to BluetoothAdapterAndroid::nativeOnAdapterStateChanged
private native void nativeOnAdapterStateChanged(
« no previous file with comments | « no previous file | device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothDevice.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698