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

Unified Diff: device/bluetooth/bluetooth_device_android.cc

Issue 1592733002: Clear the BLE services list on disconnect. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix the bluetooth/getPrimaryService.html timeout issue Created 4 years, 11 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 | « device/bluetooth/bluetooth_device.cc ('k') | device/bluetooth/bluetooth_device_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluetooth_device_android.cc
diff --git a/device/bluetooth/bluetooth_device_android.cc b/device/bluetooth/bluetooth_device_android.cc
index 71e4d0578f3c33784ca740aae4d666a92697a311..71ceb666998d4d66ba56ba4138cb005e4fe6c78e 100644
--- a/device/bluetooth/bluetooth_device_android.cc
+++ b/device/bluetooth/bluetooth_device_android.cc
@@ -210,6 +210,9 @@ void BluetoothDeviceAndroid::OnConnectionStateChange(
if (gatt_connected_) {
DidConnectGatt();
} else {
+ gatt_services_.clear();
+ SetGattServicesDiscoveryComplete(false);
+
switch (status) { // Constants are from android.bluetooth.BluetoothGatt.
case 0x0000008f: // GATT_CONNECTION_CONGESTED
return DidFailToConnectGatt(ERROR_CONNECTION_CONGESTED);
@@ -241,6 +244,7 @@ void BluetoothDeviceAndroid::OnConnectionStateChange(
void BluetoothDeviceAndroid::OnGattServicesDiscovered(
JNIEnv* env,
const JavaParamRef<jobject>& jcaller) {
+ SetGattServicesDiscoveryComplete(true);
FOR_EACH_OBSERVER(BluetoothAdapter::Observer, GetAdapter()->GetObservers(),
GattServicesDiscovered(GetAdapter(), this));
}
« no previous file with comments | « device/bluetooth/bluetooth_device.cc ('k') | device/bluetooth/bluetooth_device_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698