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

Unified Diff: device/bluetooth/bluetooth_remote_gatt_service_chromeos.cc

Issue 346743002: device/bluetooth: Send GattServiceChanged event for new Chrc. properties. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Simple rebase Created 6 years, 6 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_remote_gatt_service_chromeos.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluetooth_remote_gatt_service_chromeos.cc
diff --git a/device/bluetooth/bluetooth_remote_gatt_service_chromeos.cc b/device/bluetooth/bluetooth_remote_gatt_service_chromeos.cc
index 81aaa3d0eae14ef81e7d0cafa4f4231d0e9f45c9..4f88edfa74a60006653d1c016cb8a64cd39961b3 100644
--- a/device/bluetooth/bluetooth_remote_gatt_service_chromeos.cc
+++ b/device/bluetooth/bluetooth_remote_gatt_service_chromeos.cc
@@ -250,4 +250,27 @@ void BluetoothRemoteGattServiceChromeOS::GattCharacteristicRemoved(
delete characteristic;
}
+void BluetoothRemoteGattServiceChromeOS::GattCharacteristicPropertyChanged(
+ const dbus::ObjectPath& object_path,
+ const std::string& property_name) {
+ if (characteristics_.find(object_path) == characteristics_.end()) {
+ VLOG(2) << "Properties of unknown characteristic changed";
+ return;
+ }
+
+ // We may receive a property changed event in certain cases, e.g. when the
+ // characteristic "Flags" property has been updated with values from the
+ // "Characteristic Extended Properties" descriptor. In this case, kick off
+ // a service changed observer event to let observers refresh the
+ // characteristics.
+ BluetoothGattCharacteristicClient::Properties* properties =
+ DBusThreadManager::Get()->GetBluetoothGattCharacteristicClient()->
+ GetProperties(object_path);
+ DCHECK(properties);
+ if (property_name != properties->flags.name())
+ return;
+
+ NotifyServiceChanged();
+}
+
} // namespace chromeos
« no previous file with comments | « device/bluetooth/bluetooth_remote_gatt_service_chromeos.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698