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

Unified Diff: device/bluetooth/bluez/bluetooth_remote_gatt_service_bluez.cc

Issue 2728623004: Fix getting notified twice after subscribe to notifications and call readValue (Closed)
Patch Set: address comments Created 3 years, 10 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/bluez/bluetooth_remote_gatt_service_bluez.cc
diff --git a/device/bluetooth/bluez/bluetooth_remote_gatt_service_bluez.cc b/device/bluetooth/bluez/bluetooth_remote_gatt_service_bluez.cc
index 50786999f1a37aa11a18e6e7c85b933263ec2af0..5334974f183d0f63bf9c1b2b58acd153bc6463ca 100644
--- a/device/bluetooth/bluez/bluetooth_remote_gatt_service_bluez.cc
+++ b/device/bluetooth/bluez/bluetooth_remote_gatt_service_bluez.cc
@@ -243,9 +243,14 @@ void BluetoothRemoteGattServiceBlueZ::GattCharacteristicPropertyChanged(
if (property_name == properties->flags.name())
NotifyServiceChanged();
- else if (property_name == properties->value.name())
- GetAdapter()->NotifyGattCharacteristicValueChanged(
- iter->second, properties->value.value());
+ else if (property_name == properties->value.name()) {
+ if (iter->second->characteristic_value_read_in_progress()) {
+ iter->second->set_characteristic_value_read_in_progress(false);
+ } else {
+ GetAdapter()->NotifyGattCharacteristicValueChanged(
+ iter->second, properties->value.value());
+ }
+ }
}
} // namespace bluez

Powered by Google App Engine
This is Rietveld 408576698