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

Unified Diff: device/bluetooth/bluetooth_device_android.cc

Issue 1464443002: bluetooth: android: Add BluetoothDevice::ConnectErrorCode enums (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: II Created 5 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
Index: device/bluetooth/bluetooth_device_android.cc
diff --git a/device/bluetooth/bluetooth_device_android.cc b/device/bluetooth/bluetooth_device_android.cc
index e817350ec9fe790716106798725df102fd810ef7..f71ad0741bcb3a916c785f2fa432c389341ce6ae 100644
--- a/device/bluetooth/bluetooth_device_android.cc
+++ b/device/bluetooth/bluetooth_device_android.cc
@@ -208,13 +208,25 @@ void BluetoothDeviceAndroid::OnConnectionStateChange(JNIEnv* env,
if (gatt_connected_) {
DidConnectGatt();
} else {
- // TODO(scheib) Create new BluetoothDevice::ConnectErrorCode enums for
- // android values not yet represented. http://crbug.com/531058
switch (status) { // Constants are from android.bluetooth.BluetoothGatt.
case 0x00000101: // GATT_FAILURE
scheib 2015/11/24 01:30:48 Please sort this list by the Android Enum names. (
Kai Jiang 2015/11/25 14:17:13 Done.
return DidFailToConnectGatt(ERROR_FAILED);
+ case 0x0000008f: // GATT_CONNECTION_CONGESTED
+ return DidFailToConnectGatt(ERROR_CONNECTION_CONGESTED);
+ case 0x0000000f: // GATT_INSUFFICIENT_ENCRYPTION
+ return DidFailToConnectGatt(ERROR_INSUFFICIENT_ENCRYPTION);
+ case 0x0000000d: // GATT_INVALID_ATTRIBUTE_LENGTH
+ return DidFailToConnectGatt(ERROR_ATTRIBUTE_LENGTH_INVALID);
+ case 0x00000007: // GATT_INVALID_OFFSET
+ return DidFailToConnectGatt(ERROR_OFFSET_INVALID);
+ case 0x00000006: // GATT_REQUEST_NOT_SUPPORTED
+ return DidFailToConnectGatt(ERROR_REQUEST_NOT_SUPPORTED);
case 0x00000005: // GATT_INSUFFICIENT_AUTHENTICATION
return DidFailToConnectGatt(ERROR_AUTH_FAILED);
+ case 0x00000003: // GATT_WRITE_NOT_PERMITTED
+ return DidFailToConnectGatt(ERROR_WRITE_FAILED);
+ case 0x00000002: // GATT_READ_NOT_PERMITTED
+ return DidFailToConnectGatt(ERROR_READ_FAILED);
scheib 2015/11/24 01:30:48 More instances of 'failed' and 'not supported'.
Kai Jiang 2015/11/25 14:17:13 Could you explain a little bit more? Do you mean r
scheib 2015/11/26 00:02:50 Android enumerations that use a suffix "_NOT_PERMI
case 0x00000000: // GATT_SUCCESS
return DidDisconnectGatt();
default:

Powered by Google App Engine
This is Rietveld 408576698