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

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: I 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
« device/bluetooth/bluetooth_device.h ('K') | « device/bluetooth/bluetooth_device.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..a88d50046885ef958c97a5afa792921d0b84ae61 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
return DidFailToConnectGatt(ERROR_FAILED);
+ case 0x0000008f: // GATT_CONNECTION_CONGESTED
+ return DidFailToConnectGatt(ERROR_CONNECTION_CONGESTED);
+ case 0x0000000f: // GATT_INSUFFICIENT_ENCRYPTION
scheib 2015/11/19 22:25:05 'Insufficient' is more specific than 'failed', let
+ return DidFailToConnectGatt(ERROR_ENCRYPTION_FAILED);
+ 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_FAILED);
scheib 2015/11/19 22:25:06 'Failed' and 'Not supported' have different meanin
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);
case 0x00000000: // GATT_SUCCESS
return DidDisconnectGatt();
default:
« device/bluetooth/bluetooth_device.h ('K') | « device/bluetooth/bluetooth_device.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698