| 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..ae329601e9cc30d208c35ca04f05f8439c11d5cf 100644
|
| --- a/device/bluetooth/bluetooth_device_android.cc
|
| +++ b/device/bluetooth/bluetooth_device_android.cc
|
| @@ -50,9 +50,13 @@ 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_ = UUIDList(uuid_strings.begin(), uuid_strings.end());
|
| }
|
|
|
| // static
|
| @@ -134,20 +138,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;
|
| @@ -251,6 +241,7 @@ void BluetoothDeviceAndroid::OnConnectionStateChange(
|
| // Otherwise an existing connection was terminated.
|
| RecordConnectionTerminatedResult(status);
|
| gatt_services_.clear();
|
| + service_uuids_.clear();
|
| SetGattServicesDiscoveryComplete(false);
|
| DidDisconnectGatt();
|
| }
|
| @@ -259,6 +250,7 @@ void BluetoothDeviceAndroid::OnConnectionStateChange(
|
| void BluetoothDeviceAndroid::OnGattServicesDiscovered(
|
| JNIEnv* env,
|
| const JavaParamRef<jobject>& jcaller) {
|
| + UpdateServiceUUIDs();
|
| SetGattServicesDiscoveryComplete(true);
|
| adapter_->NotifyGattServicesDiscovered(this);
|
| }
|
|
|