Add the pairing string for CSIP supported device am: f57f720c38
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1903830 Change-Id: I809634c657558da125e72bb1fcbddaf3db46a093
This commit is contained in:
@@ -28,6 +28,7 @@ import androidx.annotation.VisibleForTesting;
|
||||
|
||||
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 @@ public class BluetoothPairingController implements OnCheckedChangeListener,
|
||||
private String mDeviceName;
|
||||
private LocalBluetoothProfile mPbapClientProfile;
|
||||
private boolean mPbapAllowed;
|
||||
private boolean mIsCoordinatedSetMember;
|
||||
|
||||
/**
|
||||
* Creates an instance of a BluetoothPairingController.
|
||||
@@ -90,6 +92,10 @@ public class BluetoothPairingController implements OnCheckedChangeListener,
|
||||
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
|
||||
@@ -155,6 +161,15 @@ public class BluetoothPairingController implements OnCheckedChangeListener,
|
||||
return mDeviceName;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
|
@@ -344,6 +344,9 @@ public class BluetoothPairingDialogFragment extends InstrumentedDialogFragment i
|
||||
pairingViewContent.setVisibility(View.VISIBLE);
|
||||
pairingViewContent.setText(mPairingController.getPairingContent());
|
||||
}
|
||||
final TextView messagePairingSet = (TextView) view.findViewById(R.id.pairing_group_message);
|
||||
messagePairingSet.setVisibility(mPairingController.isCoordinatedSetMemberDevice()
|
||||
? View.VISIBLE : View.GONE);
|
||||
return view;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user