Commit 9bdca957 authored by Conley Owens's avatar Conley Owens Committed by Commit Bot

bluetooth: Mark GattServiceChanged as deprecated

Similar adapter observer methods have already been marked deprecated.
GattServiceChanged is not all too different since it is fired when
essentially the device changes shape (attributes are added/removed).

This change also removes a platform-specific use of
gatt_service_changed_count() and gatt_characteristic_added_count().

BUG=710352

Change-Id: Iffe8118083ec10ba762eacb18886bca3acda2d58
Reviewed-on: https://chromium-review.googlesource.com/776354
Commit-Queue: Conley Owens <cco3@chromium.org>
Commit-Queue: Vincent Scheib <scheib@chromium.org>
Reviewed-by: default avatarVincent Scheib <scheib@chromium.org>
Cr-Commit-Position: refs/heads/master@{#517498}
parent c041c36e
......@@ -184,6 +184,8 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAdapter
BluetoothAdapter* adapter,
BluetoothRemoteGattService* service) {}
// See "Deprecated GATT Added/Removed Events NOTE" above.
//
// Called when properties of the remote GATT service |service| have changed.
// This will get called for properties such as UUID, as well as for changes
// to the list of known characteristics and included services. Observers
......
......@@ -286,10 +286,6 @@ TEST_F(BluetoothRemoteGattServiceTest, GattCharacteristics_ObserversCalls) {
/* properties */ 0);
SimulateGattCharacteristic(service, kTestUUIDReconnectionAddress,
/* properties */ 0);
#if !defined(OS_WIN)
// TODO(620895) GattCharacteristicAdded has to be implemented for Windows.
EXPECT_EQ(4, observer.gatt_characteristic_added_count());
#endif // !defined(OS_WIN)
// Simulate remove of characteristics one by one.
EXPECT_EQ(4u, service->GetCharacteristics().size());
......@@ -317,15 +313,6 @@ TEST_F(BluetoothRemoteGattServiceTest, GattCharacteristics_ObserversCalls) {
EXPECT_EQ(4, observer.gatt_characteristic_removed_count());
EXPECT_FALSE(service->GetCharacteristic(removed_char));
EXPECT_EQ(0u, service->GetCharacteristics().size());
#if defined(OS_MACOSX)
// SimulateGattServicesDiscovered
// 4 * SimulateGattCharacteristic
// 4 * SimulateGattCharacteristicRemoved
EXPECT_EQ(9, observer.gatt_service_changed_count());
#else // defined(OS_MACOSX)
EXPECT_EQ(4, observer.gatt_service_changed_count());
#endif // defined(OS_MACOSX)
}
#endif // defined(OS_MACOSX) || defined(OS_WIN)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment