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

Unified Diff: device/bluetooth/bluetooth_remote_gatt_characteristic_mac.mm

Issue 2051333004: Implement BluetoothGattNotifySession::Stop on Android, 2nd attempt (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address new review comments Created 4 years, 4 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/bluetooth_remote_gatt_characteristic_mac.mm
diff --git a/device/bluetooth/bluetooth_remote_gatt_characteristic_mac.mm b/device/bluetooth/bluetooth_remote_gatt_characteristic_mac.mm
index 27f8902da2657bdcb32eb99e2946c70a678c16ff..4e825a3c57b51b94d39fbc493e5a9a1b77adab54 100644
--- a/device/bluetooth/bluetooth_remote_gatt_characteristic_mac.mm
+++ b/device/bluetooth/bluetooth_remote_gatt_characteristic_mac.mm
@@ -10,7 +10,7 @@
#include "base/threading/thread_task_runner_handle.h"
#include "device/bluetooth/bluetooth_adapter_mac.h"
#include "device/bluetooth/bluetooth_device_mac.h"
-#include "device/bluetooth/bluetooth_gatt_notify_session_mac.h"
+#include "device/bluetooth/bluetooth_gatt_notify_session.h"
#include "device/bluetooth/bluetooth_remote_gatt_service_mac.h"
namespace device {
@@ -134,8 +134,8 @@ void BluetoothRemoteGattCharacteristicMac::StartNotifySession(
const ErrorCallback& error_callback) {
if (IsNotifying()) {
VLOG(2) << "Already notifying. Creating notify session.";
- std::unique_ptr<BluetoothGattNotifySessionMac> notify_session(
- new BluetoothGattNotifySessionMac(weak_ptr_factory_.GetWeakPtr()));
+ std::unique_ptr<BluetoothGattNotifySession> notify_session(
+ new BluetoothGattNotifySession(weak_ptr_factory_.GetWeakPtr()));
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE,
base::Bind(callback, base::Passed(std::move(notify_session))));
@@ -164,6 +164,15 @@ void BluetoothRemoteGattCharacteristicMac::StartNotifySession(
start_notifications_in_progress_ = true;
}
+void BluetoothRemoteGattCharacteristicMac::StopNotifySession(
+ BluetoothGattNotifySession* session,
+ const base::Closure& callback) {
+ // TODO(http://crbug.com/633191): Remove this method and use the base version.
+ // Instead, we should implement SubscribeToNotifications and
+ // UnsubscribeFromNotifications.
+ base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, callback);
+}
+
void BluetoothRemoteGattCharacteristicMac::ReadRemoteCharacteristic(
const ValueCallback& callback,
const ErrorCallback& error_callback) {
@@ -223,6 +232,22 @@ void BluetoothRemoteGattCharacteristicMac::WriteRemoteCharacteristic(
}
}
+void BluetoothRemoteGattCharacteristicMac::SubscribeToNotifications(
+ BluetoothRemoteGattDescriptor* ccc_descriptor,
+ const base::Closure& callback,
+ const ErrorCallback& error_callback) {
+ // TODO(http://crbug.com/633191): Implement this method
+ NOTIMPLEMENTED();
+}
+
+void BluetoothRemoteGattCharacteristicMac::UnsubscribeFromNotifications(
+ BluetoothRemoteGattDescriptor* ccc_descriptor,
+ const base::Closure& callback,
+ const ErrorCallback& error_callback) {
+ // TODO(http://crbug.com/633191): Implement this method
+ NOTIMPLEMENTED();
+}
+
void BluetoothRemoteGattCharacteristicMac::DidUpdateValue(NSError* error) {
// This method is called when the characteristic is read and when a
// notification is received.
@@ -306,7 +331,7 @@ void BluetoothRemoteGattCharacteristicMac::DidUpdateNotificationState(
return;
}
for (const auto& callback : reentrant_safe_callbacks) {
- callback.first.Run(base::MakeUnique<BluetoothGattNotifySessionMac>(
+ callback.first.Run(base::MakeUnique<BluetoothGattNotifySession>(
weak_ptr_factory_.GetWeakPtr()));
}
}

Powered by Google App Engine
This is Rietveld 408576698