diff options
author | Joseph Pirozzo <pirozzoj@google.com> | 2020-09-10 06:55:30 -0700 |
---|---|---|
committer | Joseph Pirozzo <pirozzoj@google.com> | 2020-09-10 13:32:03 -0700 |
commit | f87daf40c26774b3ded0abf9556b9be8b1a6623b (patch) | |
tree | 3874fa5c11a8d05b55a7899a3e8afe243052bbb7 /packages/SettingsLib/src | |
parent | 8ac6741e47c76bde065f868ea64d2f04541487b9 (diff) |
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
Diffstat (limited to 'packages/SettingsLib/src')
-rw-r--r-- | packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothProfileManager.java | 5 | ||||
-rw-r--r-- | packages/SettingsLib/src/com/android/settingslib/bluetooth/MapClientProfile.java | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothProfileManager.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothProfileManager.java index 35bbbc0e8b39..34fdc1e45567 100644 --- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothProfileManager.java +++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothProfileManager.java @@ -543,12 +543,13 @@ public class LocalBluetoothProfileManager { mPbapProfile.setEnabled(device, true); } - if (mMapClientProfile != null) { + if ((mMapClientProfile != null) + && BluetoothUuid.containsAnyUuid(uuids, MapClientProfile.UUIDS)) { profiles.add(mMapClientProfile); removedProfiles.remove(mMapClientProfile); } - if ((mPbapClientProfile != null) && ArrayUtils.contains(localUuids, BluetoothUuid.PBAP_PCE) + if ((mPbapClientProfile != null) && BluetoothUuid.containsAnyUuid(uuids, PbapClientProfile.SRC_UUIDS)) { profiles.add(mPbapClientProfile); removedProfiles.remove(mPbapClientProfile); diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/MapClientProfile.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/MapClientProfile.java index 19cb2f59f321..4881a86b398a 100644 --- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/MapClientProfile.java +++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/MapClientProfile.java @@ -47,8 +47,6 @@ public final class MapClientProfile implements LocalBluetoothProfile { private final LocalBluetoothProfileManager mProfileManager; static final ParcelUuid[] UUIDS = { - BluetoothUuid.MAP, - BluetoothUuid.MNS, BluetoothUuid.MAS, }; |