Add the pairing string for CSIP supported device am: f57f720c38 am: 5d1aee76c2 am: 2135db2eac

Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1903830

Change-Id: I000242e2e51627507bb49e7f6f51d8a5602de493
This commit is contained in:
Alice Kuo
2021-11-29 03:04:07 +00:00
committed by Automerger Merge Worker
5 changed files with 61 additions and 0 deletions

View File

@@ -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.
*

View File

@@ -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;
}