aboutsummaryrefslogtreecommitdiff
path: root/framework/java/android/bluetooth/BluetoothDevice.java
diff options
context:
space:
mode:
authorRahul Sabnis <rahulsabnis@google.com>2022-01-25 19:15:07 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2022-01-25 19:15:07 +0000
commit79a7e9543b33e261e34c63a5030255fc0e61f0c6 (patch)
treef63ec40ec719d126ae0548ba4abe20abc3446e46 /framework/java/android/bluetooth/BluetoothDevice.java
parent25af177d21d99729cc694b4e7d0a8aea2aae38fb (diff)
parent3293528b8a0d31da685c1642d0a3f52197a4c501 (diff)
Merge "Add new extra EXTRA_TRANSPORT for acl connection state broadcasts to identify whether the connection is over LE or BR/EDR" am: 94339d1b2b am: 7162d3d7d9 am: d1cdfb8bf5 am: 3293528b8a
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/1959744 Change-Id: I14775eb3b3c950e270db724c237a6a241a5f283e
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothDevice.java')
-rw-r--r--framework/java/android/bluetooth/BluetoothDevice.java16
1 files changed, 12 insertions, 4 deletions
diff --git a/framework/java/android/bluetooth/BluetoothDevice.java b/framework/java/android/bluetooth/BluetoothDevice.java
index 4055ad80c3..434f4c531d 100644
--- a/framework/java/android/bluetooth/BluetoothDevice.java
+++ b/framework/java/android/bluetooth/BluetoothDevice.java
@@ -135,7 +135,7 @@ public final class BluetoothDevice implements Parcelable, Attributable {
/**
* Broadcast Action: Indicates a low level (ACL) connection has been
* established with a remote device.
- * <p>Always contains the extra field {@link #EXTRA_DEVICE}.
+ * <p>Always contains the extra fields {@link #EXTRA_DEVICE} and {@link #EXTRA_TRANSPORT}.
* <p>ACL connections are managed automatically by the Android Bluetooth
* stack.
*/
@@ -164,7 +164,7 @@ public final class BluetoothDevice implements Parcelable, Attributable {
/**
* Broadcast Action: Indicates a low level (ACL) disconnection from a
* remote device.
- * <p>Always contains the extra field {@link #EXTRA_DEVICE}.
+ * <p>Always contains the extra fields {@link #EXTRA_DEVICE} and {@link #EXTRA_TRANSPORT}.
* <p>ACL connections are managed automatically by the Android Bluetooth
* stack.
*/
@@ -1050,12 +1050,12 @@ public final class BluetoothDevice implements Parcelable, Attributable {
public static final int TRANSPORT_AUTO = 0;
/**
- * Prefer BR/EDR transport for GATT connections to remote dual-mode devices
+ * Constant representing the BR/EDR transport.
*/
public static final int TRANSPORT_BREDR = 1;
/**
- * Prefer LE transport for GATT connections to remote dual-mode devices
+ * Constant representing the Bluetooth Low Energy (BLE) Transport.
*/
public static final int TRANSPORT_LE = 2;
@@ -1115,6 +1115,14 @@ public final class BluetoothDevice implements Parcelable, Attributable {
public static final String EXTRA_MAS_INSTANCE =
"android.bluetooth.device.extra.MAS_INSTANCE";
+ /**
+ * Used as an int extra field in {@link #ACTION_ACL_CONNECTED} and
+ * {@link #ACTION_ACL_DISCONNECTED} intents to indicate which transport is connected.
+ * Possible values are: {@link #TRANSPORT_BREDR} and {@link #TRANSPORT_LE}.
+ */
+ @SuppressLint("ActionValue")
+ public static final String EXTRA_TRANSPORT = "android.bluetooth.device.extra.TRANSPORT";
+
/** @hide */
@Retention(RetentionPolicy.SOURCE)
@IntDef(