Don't add profiles to device details page if it's null

Change-Id: Ia79fa600c87905a6a2cbf8459910d67ffb9d22dd
BUG: 341293298
Test: manually test in tablet
Flag: EXEMPT minor bug fix
This commit is contained in:
Haijie Hong
2024-07-24 09:11:46 +00:00
parent 83f934b5b0
commit 24bf20f033

View File

@@ -334,12 +334,14 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll
// Only provide PBAP cabability if the client device has requested PBAP.
if (pbapPermission != BluetoothDevice.ACCESS_UNKNOWN) {
final PbapServerProfile psp = mManager.getProfileManager().getPbapProfile();
result.add(psp);
if (psp != null) {
result.add(psp);
}
}
final MapProfile mapProfile = mManager.getProfileManager().getMapProfile();
final int mapPermission = device.getMessageAccessPermission();
if (mapPermission != BluetoothDevice.ACCESS_UNKNOWN) {
if (mapPermission != BluetoothDevice.ACCESS_UNKNOWN && mapProfile != null) {
result.add(mapProfile);
}