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

Unified Diff: device/bluetooth/test/bluetooth_test_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/test/bluetooth_test_android.cc
diff --git a/device/bluetooth/test/bluetooth_test_android.cc b/device/bluetooth/test/bluetooth_test_android.cc
index 26f5f29acd03ba78535b841a286488d2905a5996..d1451258d4f4df1d81ebaf669dafb2fab9d30400 100644
--- a/device/bluetooth/test/bluetooth_test_android.cc
+++ b/device/bluetooth/test/bluetooth_test_android.cc
@@ -86,18 +86,40 @@ void BluetoothTestAndroid::SimulateGattConnectionError(
BluetoothDevice::ConnectErrorCode error) {
int android_error_value = 0;
switch (error) { // Constants are from android.bluetooth.BluetoothGatt.
- case BluetoothDevice::ERROR_FAILED:
- android_error_value = 0x00000101; // GATT_FAILURE
+ case BluetoothDevice::ERROR_ATTRIBUTE_LENGTH_INVALID:
+ android_error_value = 0x0000000d; // GATT_INVALID_ATTRIBUTE_LENGTH
break;
case BluetoothDevice::ERROR_AUTH_FAILED:
android_error_value = 0x00000005; // GATT_INSUFFICIENT_AUTHENTICATION
break;
- case BluetoothDevice::ERROR_UNKNOWN:
- case BluetoothDevice::ERROR_INPROGRESS:
+ case BluetoothDevice::ERROR_CONNECTION_CONGESTED:
+ android_error_value = 0x0000008f; // GATT_CONNECTION_CONGESTED
+ break;
+ case BluetoothDevice::ERROR_FAILED:
+ android_error_value = 0x00000101; // GATT_FAILURE
+ break;
+ case BluetoothDevice::ERROR_INSUFFICIENT_ENCRYPTION:
+ android_error_value = 0x0000000f; // GATT_INSUFFICIENT_ENCRYPTION
+ break;
+ case BluetoothDevice::ERROR_OFFSET_INVALID:
+ android_error_value = 0x00000007; // GATT_INVALID_OFFSET
+ break;
+ case BluetoothDevice::ERROR_READ_NOT_PERMITTED:
+ android_error_value = 0x00000002; // GATT_READ_NOT_PERMITTED
+ break;
+ case BluetoothDevice::ERROR_REQUEST_NOT_SUPPORTED:
+ android_error_value = 0x00000006; // GATT_REQUEST_NOT_SUPPORTED
+ break;
+ case BluetoothDevice::ERROR_WRITE_NOT_PERMITTED:
+ android_error_value = 0x00000003; // GATT_WRITE_NOT_PERMITTED
+ break;
case BluetoothDevice::ERROR_AUTH_CANCELED:
case BluetoothDevice::ERROR_AUTH_REJECTED:
case BluetoothDevice::ERROR_AUTH_TIMEOUT:
+ case BluetoothDevice::ERROR_INPROGRESS:
+ case BluetoothDevice::ERROR_UNKNOWN:
case BluetoothDevice::ERROR_UNSUPPORTED_DEVICE:
+ case BluetoothDevice::NUM_CONNECT_ERROR_CODES:
NOTREACHED() << "No translation for error code: " << error;
}

Powered by Google App Engine
This is Rietveld 408576698