Configure Bluetooth profiles displayed in settings

Two profiles were displayed on automotive targets at the wrong times,
MAP was displayed for all devices, PBAP was displayed only when
enabled.  This updates those two profiles to appear in the profiles only
when the service is enabled locally and the remote device supports the
other half of the connection.

Bug: 109783106
Test: pair with bluetooth devices that support (and don't support) MAP
and PBAP, and verify settings slider appears when appropriate
specifically when disabled.

Change-Id: I62b8778517730076554ba996cee80862ce72539b
This commit is contained in:
Joseph Pirozzo
2020-09-10 06:55:30 -07:00
parent 8ac6741e47
commit f87daf40c2
2 changed files with 3 additions and 4 deletions

View File

@@ -543,12 +543,13 @@ public class LocalBluetoothProfileManager {
mPbapProfile.setEnabled(device, true); mPbapProfile.setEnabled(device, true);
} }
if (mMapClientProfile != null) { if ((mMapClientProfile != null)
&& BluetoothUuid.containsAnyUuid(uuids, MapClientProfile.UUIDS)) {
profiles.add(mMapClientProfile); profiles.add(mMapClientProfile);
removedProfiles.remove(mMapClientProfile); removedProfiles.remove(mMapClientProfile);
} }
if ((mPbapClientProfile != null) && ArrayUtils.contains(localUuids, BluetoothUuid.PBAP_PCE) if ((mPbapClientProfile != null)
&& BluetoothUuid.containsAnyUuid(uuids, PbapClientProfile.SRC_UUIDS)) { && BluetoothUuid.containsAnyUuid(uuids, PbapClientProfile.SRC_UUIDS)) {
profiles.add(mPbapClientProfile); profiles.add(mPbapClientProfile);
removedProfiles.remove(mPbapClientProfile); removedProfiles.remove(mPbapClientProfile);

View File

@@ -47,8 +47,6 @@ public final class MapClientProfile implements LocalBluetoothProfile {
private final LocalBluetoothProfileManager mProfileManager; private final LocalBluetoothProfileManager mProfileManager;
static final ParcelUuid[] UUIDS = { static final ParcelUuid[] UUIDS = {
BluetoothUuid.MAP,
BluetoothUuid.MNS,
BluetoothUuid.MAS, BluetoothUuid.MAS,
}; };