diff options
| author | Nick Pelly <npelly@google.com> | 2009-09-08 17:40:43 -0700 |
|---|---|---|
| committer | Nick Pelly <npelly@google.com> | 2009-09-09 10:52:18 -0700 |
| commit | 8a1cd0cdce892a6bd25bc7292007fe0220b3ae10 (patch) | |
| tree | f97f1762f160fe595ae28af9079e7d92cd7ef31f /framework/java/android/bluetooth/BluetoothAdapter.java | |
| parent | 7482a80ce3d46f9991302cc464bc6a9e5a317451 (diff) | |
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.
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothAdapter.java')
| -rw-r--r-- | framework/java/android/bluetooth/BluetoothAdapter.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/framework/java/android/bluetooth/BluetoothAdapter.java b/framework/java/android/bluetooth/BluetoothAdapter.java index 1770bc7935..18f6995d26 100644 --- a/framework/java/android/bluetooth/BluetoothAdapter.java +++ b/framework/java/android/bluetooth/BluetoothAdapter.java @@ -43,6 +43,15 @@ public final class BluetoothAdapter { private static final String TAG = "BluetoothAdapter"; /** + * Sentinel error value for this class. Guaranteed to not equal any other + * integer constant in this class. Provided as a convenience for functions + * that require a sentinel error value, for example: + * <p><code>Intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, + * BluetoothAdapter.ERROR)</code> + */ + public static final int ERROR = -1; + + /** * Broadcast Action: The state of the local Bluetooth adapter has been * changed. * <p>For example, Bluetooth has been turned on or off. |
