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

Unified Diff: device/bluetooth/bluetooth_device_android.cc

Issue 2205693003: bluetooth: Replace old advertised uuids (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@my-origin
Patch Set: Fix mac 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
Index: device/bluetooth/bluetooth_device_android.cc
diff --git a/device/bluetooth/bluetooth_device_android.cc b/device/bluetooth/bluetooth_device_android.cc
index ac48b1bf982dedaf9e38212125183ed78efb7799..58f4339bd2a705d737a4a67a4f0e3d8a5b8768f1 100644
--- a/device/bluetooth/bluetooth_device_android.cc
+++ b/device/bluetooth/bluetooth_device_android.cc
@@ -50,9 +50,16 @@ BluetoothDeviceAndroid::~BluetoothDeviceAndroid() {
AttachCurrentThread(), j_device_.obj());
}
-bool BluetoothDeviceAndroid::UpdateAdvertisedUUIDs(jobject advertised_uuids) {
- return Java_ChromeBluetoothDevice_updateAdvertisedUUIDs(
- AttachCurrentThread(), j_device_.obj(), advertised_uuids);
+void BluetoothDeviceAndroid::UpdateAdvertisedUUIDs(
+ jobjectArray advertised_uuids) {
+ JNIEnv* env = AttachCurrentThread();
+ std::vector<std::string> uuid_strings;
+ AppendJavaStringArrayToStringVector(env, advertised_uuids, &uuid_strings);
+
+ advertised_uuids_.clear();
+ for (auto uuid_string : uuid_strings) {
+ advertised_uuids_.emplace(uuid_string);
+ }
}
// static
@@ -134,20 +141,6 @@ bool BluetoothDeviceAndroid::IsConnecting() const {
return false;
}
-BluetoothDevice::UUIDList BluetoothDeviceAndroid::GetUUIDs() const {
- JNIEnv* env = AttachCurrentThread();
- std::vector<std::string> uuid_strings;
- AppendJavaStringArrayToStringVector(
- env, Java_ChromeBluetoothDevice_getUuids(env, j_device_.obj()).obj(),
- &uuid_strings);
- BluetoothDevice::UUIDList uuids;
- uuids.reserve(uuid_strings.size());
- for (auto uuid_string : uuid_strings) {
- uuids.push_back(BluetoothUUID(uuid_string));
- }
- return uuids;
-}
-
int16_t BluetoothDeviceAndroid::GetInquiryRSSI() const {
NOTIMPLEMENTED();
return kUnknownPower;

Powered by Google App Engine
This is Rietveld 408576698