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

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: III 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/test/bluetooth_test_android.cc
diff --git a/device/bluetooth/test/bluetooth_test_android.cc b/device/bluetooth/test/bluetooth_test_android.cc
index 3e9d83ffaf4be1e95a644c56e73a212c97342d2c..00c30a6ab029c5dc2523f5440c0ae1396052825d 100644
--- a/device/bluetooth/test/bluetooth_test_android.cc
+++ b/device/bluetooth/test/bluetooth_test_android.cc
@@ -86,17 +86,38 @@ void BluetoothTestAndroid::SimulateGattConnectionError(
BluetoothDevice::ConnectErrorCode error) {
int android_error_value = 0;
switch (error) { // Constants are from android.bluetooth.BluetoothGatt.
+ case BluetoothDevice::ERROR_CONNECTION_CONGESTED:
scheib 2015/11/26 00:02:51 Sort list alphabetically.
Kai Jiang 2015/11/29 10:40:51 Done.
+ android_error_value = 0x0000008f; // GATT_CONNECTION_CONGESTED
+ break;
case BluetoothDevice::ERROR_FAILED:
android_error_value = 0x00000101; // GATT_FAILURE
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_INSUFFICIENT_ENCRYPTION:
+ android_error_value = 0x0000000f; // GATT_INSUFFICIENT_ENCRYPTION
+ break;
+ case BluetoothDevice::ERROR_ATTRIBUTE_LENGTH_INVALID:
+ android_error_value = 0x0000000d; // GATT_INVALID_ATTRIBUTE_LENGTH
+ break;
+ case BluetoothDevice::ERROR_OFFSET_INVALID:
+ android_error_value = 0x00000007; // GATT_INVALID_OFFSET
+ break;
+ case BluetoothDevice::ERROR_READ_FAILED:
+ 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_FAILED:
Kai Jiang 2015/11/29 10:40:51 ERROR_{READ, 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:
NOTREACHED() << "No translation for error code: " << error;
}

Powered by Google App Engine
This is Rietveld 408576698