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

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: updated test code Created 3 years, 9 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/bluez/bluetooth_remote_gatt_characteristic_bluez.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..a11fcd87525c416af287fa9cfe3907a9e2eea812 100644
--- a/device/bluetooth/bluez/bluetooth_remote_gatt_service_bluez.cc
+++ b/device/bluetooth/bluez/bluetooth_remote_gatt_service_bluez.cc
@@ -243,9 +243,15 @@ 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()) {
+ DCHECK_GE(iter->second->num_of_characteristic_value_read_in_progress_, 0);
+ if (iter->second->num_of_characteristic_value_read_in_progress_ > 0) {
+ --iter->second->num_of_characteristic_value_read_in_progress_;
+ } else {
+ GetAdapter()->NotifyGattCharacteristicValueChanged(
+ iter->second, properties->value.value());
+ }
+ }
}
} // namespace bluez
« no previous file with comments | « device/bluetooth/bluez/bluetooth_remote_gatt_characteristic_bluez.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698