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

Unified Diff: device/bluetooth/bluetooth_remote_gatt_characteristic_android.h

Issue 2241263005: Revert of Implement BluetoothGattNotifySession::Stop on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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_android.h
diff --git a/device/bluetooth/bluetooth_remote_gatt_characteristic_android.h b/device/bluetooth/bluetooth_remote_gatt_characteristic_android.h
index c0606b420c7ae2c6bf6adffeda5d320bd660faa4..eed5c4623c56eb9384a41c552d9f0aa8d0991be6 100644
--- a/device/bluetooth/bluetooth_remote_gatt_characteristic_android.h
+++ b/device/bluetooth/bluetooth_remote_gatt_characteristic_android.h
@@ -61,14 +61,24 @@
BluetoothRemoteGattService* GetService() const override;
Properties GetProperties() const override;
Permissions GetPermissions() const override;
+ bool IsNotifying() const override;
std::vector<BluetoothRemoteGattDescriptor*> GetDescriptors() const override;
BluetoothRemoteGattDescriptor* GetDescriptor(
const std::string& identifier) const override;
+ void StartNotifySession(const NotifySessionCallback& callback,
+ const ErrorCallback& error_callback) override;
void ReadRemoteCharacteristic(const ValueCallback& callback,
const ErrorCallback& error_callback) override;
void WriteRemoteCharacteristic(const std::vector<uint8_t>& new_value,
const base::Closure& callback,
const ErrorCallback& error_callback) override;
+
+ // Called when StartNotifySession operation succeeds.
+ void OnStartNotifySessionSuccess();
+
+ // Called when StartNotifySession operation fails.
+ void OnStartNotifySessionError(
+ BluetoothRemoteGattService::GattErrorCode error);
// Called when value changed event occurs.
void OnChanged(JNIEnv* env,
@@ -99,15 +109,6 @@
jobject>& /* ChromeBluetoothCharacteristic */
chrome_bluetooth_characteristic);
- protected:
- void SubscribeToNotifications(BluetoothRemoteGattDescriptor* ccc_descriptor,
- const base::Closure& callback,
- const ErrorCallback& error_callback) override;
- void UnsubscribeFromNotifications(
- BluetoothRemoteGattDescriptor* ccc_descriptor,
- const base::Closure& callback,
- const ErrorCallback& error_callback) override;
-
private:
BluetoothRemoteGattCharacteristicAndroid(
BluetoothAdapterAndroid* adapter,
@@ -128,6 +129,11 @@
// Adapter unique instance ID.
std::string instance_id_;
+
+ // StartNotifySession callbacks and pending state.
+ typedef std::pair<NotifySessionCallback, ErrorCallback>
+ PendingStartNotifyCall;
+ std::vector<PendingStartNotifyCall> pending_start_notify_calls_;
// ReadRemoteCharacteristic callbacks and pending state.
bool read_pending_ = false;

Powered by Google App Engine
This is Rietveld 408576698