API_CHANGE
Deprecate BluetoothError.java.
I spent a lot of time experimenting with a class BluetoothError to enumerate
the many error codes returned by the Bluetooth API. But at the end of the day
they were never used. The vast majority of method calls only really need a
true/false error value, and often not even that.
Methods which do need more detailed error enumeration (for example, bonding
failures) can have there own enumerated error codes. But there is no need
for a common set of error codes.
Also change the IPC failed warnings in BluetoothA2dp to Log.e. These indicate
a very serious error.
Introduce BluetoothAdapter.ERROR and BluetoothDevice.ERROR as helper sentinel
values.
diff --git a/core/java/android/server/BluetoothEventLoop.java b/core/java/android/server/BluetoothEventLoop.java
index 9f36f7e..b5eb9ac 100644
--- a/core/java/android/server/BluetoothEventLoop.java
+++ b/core/java/android/server/BluetoothEventLoop.java
@@ -20,7 +20,6 @@
import android.bluetooth.BluetoothClass;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
-import android.bluetooth.BluetoothError;
import android.bluetooth.BluetoothIntent;
import android.bluetooth.BluetoothUuid;
import android.content.Context;
@@ -169,7 +168,7 @@
private void onCreatePairedDeviceResult(String address, int result) {
address = address.toUpperCase();
- if (result == BluetoothError.SUCCESS) {
+ if (result == BluetoothDevice.BOND_SUCCESS) {
mBluetoothService.getBondState().setBondState(address, BluetoothDevice.BOND_BONDED);
if (mBluetoothService.getBondState().isAutoPairingAttemptsInProgress(address)) {
mBluetoothService.getBondState().clearPinAttempts(address);