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

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: VI Created 4 years, 11 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_device_android.cc
diff --git a/device/bluetooth/bluetooth_device_android.cc b/device/bluetooth/bluetooth_device_android.cc
index ebd78318e52c0bef7a4338feb9edc3a81dcf5bfa..cb142563d043a928919ff9b5dc0fc46fca2019ea 100644
--- a/device/bluetooth/bluetooth_device_android.cc
+++ b/device/bluetooth/bluetooth_device_android.cc
@@ -210,15 +210,27 @@ void BluetoothDeviceAndroid::OnConnectionStateChange(
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 0x0000008f: // GATT_CONNECTION_CONGESTED
+ return DidFailToConnectGatt(ERROR_CONNECTION_CONGESTED);
case 0x00000101: // GATT_FAILURE
return DidFailToConnectGatt(ERROR_FAILED);
case 0x00000005: // GATT_INSUFFICIENT_AUTHENTICATION
return DidFailToConnectGatt(ERROR_AUTH_FAILED);
+ 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 0x00000002: // GATT_READ_NOT_PERMITTED
+ return DidFailToConnectGatt(ERROR_READ_NOT_PERMITTED);
+ case 0x00000006: // GATT_REQUEST_NOT_SUPPORTED
+ return DidFailToConnectGatt(ERROR_REQUEST_NOT_SUPPORTED);
case 0x00000000: // GATT_SUCCESS
return DidDisconnectGatt();
+ case 0x00000003: // GATT_WRITE_NOT_PERMITTED
+ return DidFailToConnectGatt(ERROR_WRITE_NOT_PERMITTED);
default:
VLOG(1) << "Unhandled status: " << status;
return DidFailToConnectGatt(ERROR_UNKNOWN);

Powered by Google App Engine
This is Rietveld 408576698