From 24bf20f03364341d0232465b2dc2757546aa31e1 Mon Sep 17 00:00:00 2001 From: Haijie Hong Date: Wed, 24 Jul 2024 09:11:46 +0000 Subject: [PATCH] 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 --- .../bluetooth/BluetoothDetailsProfilesController.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/com/android/settings/bluetooth/BluetoothDetailsProfilesController.java b/src/com/android/settings/bluetooth/BluetoothDetailsProfilesController.java index 91d7a2eb898..015d427f8cd 100644 --- a/src/com/android/settings/bluetooth/BluetoothDetailsProfilesController.java +++ b/src/com/android/settings/bluetooth/BluetoothDetailsProfilesController.java @@ -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); }