diff --git a/core/api/current.txt b/core/api/current.txt index a42fb7933a2fc..e4e7d4eec77de 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -8712,6 +8712,7 @@ package android.bluetooth { field public static final String EXTRA_BOND_STATE = "android.bluetooth.device.extra.BOND_STATE"; field public static final String EXTRA_CLASS = "android.bluetooth.device.extra.CLASS"; field public static final String EXTRA_DEVICE = "android.bluetooth.device.extra.DEVICE"; + field public static final String EXTRA_IS_COORDINATED_SET_MEMBER = "android.bluetooth.extra.IS_COORDINATED_SET_MEMBER"; field public static final String EXTRA_NAME = "android.bluetooth.device.extra.NAME"; field public static final String EXTRA_PAIRING_KEY = "android.bluetooth.device.extra.PAIRING_KEY"; field public static final String EXTRA_PAIRING_VARIANT = "android.bluetooth.device.extra.PAIRING_VARIANT"; diff --git a/core/java/android/bluetooth/BluetoothDevice.java b/core/java/android/bluetooth/BluetoothDevice.java index 38fb90d9c4a75..b5ede8d1cdb61 100644 --- a/core/java/android/bluetooth/BluetoothDevice.java +++ b/core/java/android/bluetooth/BluetoothDevice.java @@ -106,7 +106,7 @@ public final class BluetoothDevice implements Parcelable { *
Sent when a remote device is found during discovery. *
Always contains the extra fields {@link #EXTRA_DEVICE} and {@link * #EXTRA_CLASS}. Can contain the extra fields {@link #EXTRA_NAME} and/or - * {@link #EXTRA_RSSI} if they are available. + * {@link #EXTRA_RSSI} and/or {@link #EXTRA_IS_COORDINATED_SET_MEMBER} if they are available. *
Requires {@link android.Manifest.permission#BLUETOOTH} and
* {@link android.Manifest.permission#ACCESS_COARSE_LOCATION} to receive.
*/
@@ -256,6 +256,15 @@ public final class BluetoothDevice implements Parcelable {
*/
public static final String EXTRA_RSSI = "android.bluetooth.device.extra.RSSI";
+ /**
+ * Used as an bool extra field in {@link #ACTION_FOUND} intents.
+ * It contains the information if device is discovered as member of a coordinated set or not.
+ * Pairing with device that belongs to a set would trigger pairing with the rest of set members.
+ * See Bluetooth CSIP specification for more details.
+ */
+ public static final String EXTRA_IS_COORDINATED_SET_MEMBER =
+ "android.bluetooth.extra.IS_COORDINATED_SET_MEMBER";
+
/**
* Used as a Parcelable {@link BluetoothClass} extra field in {@link
* #ACTION_FOUND} and {@link #ACTION_CLASS_CHANGED} intents.
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothEventManager.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothEventManager.java
index 59d8acb82196a..a0869189a5bd1 100644
--- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothEventManager.java
+++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothEventManager.java
@@ -293,6 +293,8 @@ public class BluetoothEventManager {
BluetoothDevice device) {
short rssi = intent.getShortExtra(BluetoothDevice.EXTRA_RSSI, Short.MIN_VALUE);
String name = intent.getStringExtra(BluetoothDevice.EXTRA_NAME);
+ final boolean isCoordinatedSetMember =
+ intent.getBooleanExtra(BluetoothDevice.EXTRA_IS_COORDINATED_SET_MEMBER, false);
// TODO Pick up UUID. They should be available for 2.1 devices.
// Skip for now, there's a bluez problem and we are not getting uuids even for 2.1.
CachedBluetoothDevice cachedDevice = mDeviceManager.findDevice(device);
@@ -307,6 +309,7 @@ public class BluetoothEventManager {
}
cachedDevice.setRssi(rssi);
cachedDevice.setJustDiscovered(true);
+ cachedDevice.setIsCoordinatedSetMember(isCoordinatedSetMember);
}
}
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java
index 4c80b91f300de..6a590c2ff382c 100644
--- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java
+++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java
@@ -80,6 +80,8 @@ public class CachedBluetoothDevice implements Comparable