Add the pairing string for CSIP supported device
Show the pairing dialog with the hint message
that pairing this device will pair all of the
set member of a coordinated set. If the device
supports CSIP, the message will be shown.
Screenshot: https://screenshot.googleplex.com/8WcrdgBoLRgJjHs
Bug: 178981521
Test: make RunSettingsRoboTests ROBOTEST_FILTER=BlueotohPairingDialog
Change-Id: I5432b7264652dd4485e2669f6004caa4f7459238
Merged-In: I5432b7264652dd4485e2669f6004caa4f7459238
diff --git a/src/com/android/settings/bluetooth/BluetoothPairingController.java b/src/com/android/settings/bluetooth/BluetoothPairingController.java
index ca3dda6..ec5c8dd 100644
--- a/src/com/android/settings/bluetooth/BluetoothPairingController.java
+++ b/src/com/android/settings/bluetooth/BluetoothPairingController.java
@@ -28,6 +28,7 @@
import com.android.settings.R;
import com.android.settings.bluetooth.BluetoothPairingDialogFragment.BluetoothPairingDialogListener;
+import com.android.settingslib.bluetooth.CachedBluetoothDevice;
import com.android.settingslib.bluetooth.LocalBluetoothManager;
import com.android.settingslib.bluetooth.LocalBluetoothProfile;
@@ -64,6 +65,7 @@
private String mDeviceName;
private LocalBluetoothProfile mPbapClientProfile;
private boolean mPbapAllowed;
+ private boolean mIsCoordinatedSetMember;
/**
* Creates an instance of a BluetoothPairingController.
@@ -90,6 +92,10 @@
mDeviceName = mBluetoothManager.getCachedDeviceManager().getName(mDevice);
mPbapClientProfile = mBluetoothManager.getProfileManager().getPbapClientProfile();
mPasskeyFormatted = formatKey(mPasskey);
+ final CachedBluetoothDevice cachedDevice =
+ mBluetoothManager.getCachedDeviceManager().findDevice(mDevice);
+ mIsCoordinatedSetMember = (cachedDevice != null)
+ ? cachedDevice.isCoordinatedSetMemberDevice() : false;
}
@Override
@@ -156,6 +162,15 @@
}
/**
+ * A method for querying if the bluetooth device is a LE coordinated set member device.
+ *
+ * @return - A boolean indicating if the device is a CSIP supported device.
+ */
+ public boolean isCoordinatedSetMemberDevice() {
+ return mIsCoordinatedSetMember;
+ }
+
+ /**
* A method for querying if the bluetooth device has a profile already set up on this device.
*
* @return - A boolean indicating if the device has previous knowledge of a profile for this