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

Unified Diff: device/bluetooth/bluetooth_remote_gatt_characteristic_android.cc

Issue 2481683002: bluetooth:android: Run error callback when characteristic is destroyed (Closed)
Patch Set: Fix TODO Created 4 years, 1 month 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 | « no previous file | device/bluetooth/bluetooth_remote_gatt_characteristic_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluetooth_remote_gatt_characteristic_android.cc
diff --git a/device/bluetooth/bluetooth_remote_gatt_characteristic_android.cc b/device/bluetooth/bluetooth_remote_gatt_characteristic_android.cc
index ecab337479bf4658154ba0e97f6fd2e909b9422d..d40c0066584448ba65a61e67aab176efba12cb88 100644
--- a/device/bluetooth/bluetooth_remote_gatt_characteristic_android.cc
+++ b/device/bluetooth/bluetooth_remote_gatt_characteristic_android.cc
@@ -54,6 +54,15 @@ BluetoothRemoteGattCharacteristicAndroid::
~BluetoothRemoteGattCharacteristicAndroid() {
Java_ChromeBluetoothRemoteGattCharacteristic_onBluetoothRemoteGattCharacteristicAndroidDestruction(
AttachCurrentThread(), j_characteristic_);
+ if (!read_callback_.is_null()) {
+ DCHECK(!read_error_callback_.is_null());
+ read_error_callback_.Run(BluetoothGattService::GATT_ERROR_FAILED);
+ }
+
+ if (!write_callback_.is_null()) {
+ DCHECK(!write_error_callback_.is_null());
+ write_error_callback_.Run(BluetoothGattService::GATT_ERROR_FAILED);
+ }
}
// static
« no previous file with comments | « no previous file | device/bluetooth/bluetooth_remote_gatt_characteristic_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698