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

Unified Diff: device/bluetooth/bluetooth_device.cc

Issue 2625013003: bluetooth: bluez: Fixed issue with missing notifications after reconnect. (Closed)
Patch Set: Added comment about the notification. Created 3 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.h ('k') | device/bluetooth/bluetooth_device_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluetooth_device.cc
diff --git a/device/bluetooth/bluetooth_device.cc b/device/bluetooth/bluetooth_device.cc
index 7c56c127884732fcc129b68a325a909840570e18..ee84193c4e6e3e95af8dd6a4725d6412feda6bea 100644
--- a/device/bluetooth/bluetooth_device.cc
+++ b/device/bluetooth/bluetooth_device.cc
@@ -470,7 +470,11 @@ void BluetoothDevice::DidFailToConnectGatt(ConnectErrorCode error) {
create_gatt_connection_error_callbacks_.clear();
}
-void BluetoothDevice::DidDisconnectGatt() {
+void BluetoothDevice::DidDisconnectGatt(bool notifyDeviceChanged) {
+ gatt_services_.clear();
+ device_uuids_.ClearServiceUUIDs();
+ SetGattServicesDiscoveryComplete(false);
rkc1 2017/05/15 23:56:59 What is the purpose of doing this? This doesn't ac
ortuno 2017/05/16 00:04:27 This line has no effect on BlueZ since the variabl
rkc1 2017/05/16 00:10:09 Right, and since this function is being called fro
ortuno 2017/05/16 00:40:41 I agree. It's unclear what the issue was and how t
perja 2017/05/16 08:23:23 Sure, that sounds like a good approach now.
perja 2017/05/16 08:23:23 It's been a while since I looked into this, but wh
+
// Pending calls to connect GATT are not expected, if they were then
// DidFailToConnectGatt should have been called.
DCHECK(create_gatt_connection_error_callbacks_.empty());
@@ -480,7 +484,8 @@ void BluetoothDevice::DidDisconnectGatt() {
connection->InvalidateConnectionReference();
}
gatt_connections_.clear();
- GetAdapter()->NotifyDeviceChanged(this);
+ if (notifyDeviceChanged)
+ GetAdapter()->NotifyDeviceChanged(this);
}
void BluetoothDevice::AddGattConnection(BluetoothGattConnection* connection) {
« no previous file with comments | « device/bluetooth/bluetooth_device.h ('k') | device/bluetooth/bluetooth_device_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698