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)); |
} |