diff options
author | tadvana <tadvana@google.com> | 2022-01-26 10:35:38 -0800 |
---|---|---|
committer | tadvana <tadvana@google.com> | 2022-01-26 10:36:55 -0800 |
commit | f62b536dbf10265f5e03d103ba39bf939716f2b6 (patch) | |
tree | 8e2e2aa1ef76ba021dd682b5de4165bd5637774d /framework/java/android/bluetooth/BluetoothStatusCodes.java | |
parent | 4d912eeccb643ac13016a5999b6bca6349052e5b (diff) |
Introduces mechanism for background rfcomm servers
This change adds a mechanism in the AdapterService which allows it to
register RFCOMM listeners requested by a BluetoothAdapter.
This is so that applications can request the framework to listen for
incoming RFCOMM connections in the background.
Apps can request that the bluetooth manager, via a BluetoothAdapter,
listen on a specific service record, and then transact incoming socket
connections after receiving a notification of availability via a
PendingIntent.
Tag: #feature
Test: Run the CTS Bluetooth Rfcomm Handoff service Test. This requires
two devices.
Bug: 186494155
Ignore-AOSP-First: Need to commit to downstream first in order to
resolve a merge conflict.
Change-Id: Ia0c71969e691e6353f22fe3b7dae4a7500230e03
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothStatusCodes.java')
-rw-r--r-- | framework/java/android/bluetooth/BluetoothStatusCodes.java | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/framework/java/android/bluetooth/BluetoothStatusCodes.java b/framework/java/android/bluetooth/BluetoothStatusCodes.java index b1aa27decb..5017198840 100644 --- a/framework/java/android/bluetooth/BluetoothStatusCodes.java +++ b/framework/java/android/bluetooth/BluetoothStatusCodes.java @@ -371,6 +371,57 @@ public final class BluetoothStatusCodes { public static final int ERROR_CALL_ACTIVE = 1119; /** + * Indicates that the RFCOMM listener could not be started due to the requested UUID already + * being in use. + * + * @hide + */ + @SystemApi + public static final int RFCOMM_LISTENER_START_FAILED_UUID_IN_USE = 2000; + + /** + * Indicates that the operation could not be competed because the service record on which the + * operation was requested on does not exist. + * + * @hide + */ + @SystemApi + public static final int RFCOMM_LISTENER_OPERATION_FAILED_NO_MATCHING_SERVICE_RECORD = 2001; + + /** + * Indicates that the operation could not be completed because the application requesting the + * operation on the RFCOMM listener was not the one which registered it. + * + * @hide + */ + @SystemApi + public static final int RFCOMM_LISTENER_OPERATION_FAILED_DIFFERENT_APP = 2002; + + /** + * Indicates that the creation of the underlying BluetoothServerSocket failed. + * + * @hide + */ + @SystemApi + public static final int RFCOMM_LISTENER_FAILED_TO_CREATE_SERVER_SOCKET = 2003; + + /** + * Indicates that closing the underlying BluetoothServerSocket failed. + * + * @hide + */ + @SystemApi + public static final int RFCOMM_LISTENER_FAILED_TO_CLOSE_SERVER_SOCKET = 2004; + + /** + * Indicates that there is no socket available to retrieve from the given listener. + * + * @hide + */ + @SystemApi + public static final int RFCOMM_LISTENER_NO_SOCKET_AVAILABLE = 2005; + + /** * Indicates that an unknown error has occurred has occurred. */ public static final int ERROR_UNKNOWN = Integer.MAX_VALUE; |