Bluetooth: Add support for PBAP UI preference

Usecase:
1) Connect with carkit that supports PBAP/MAP
2) Try to uncheck the checkbox for contact sharing from device sub
   settings menu

Expected Result:
1) DUT should display "Connected (No Media or Phone)"
1) Should be able to disconnect when checkbox moves from selected->unselected,
and carkit should be able to connect when checkbox is selected again

Observation:
1) No UI updates when PBAP/MAP are connected.
2) On unchecking Contact sharing checkbox nothing happens. PBAP connection
   remains active and user is not asked to disconnect profile level connection.

Fix:
Add support for PBAP UI preference in SettingsLib. Also Fix issues related to MAP
profile addition/removal.
Test: Connect from carkit, try disconnecting from sub settings menu by unchecking
Contact Sharing checkbox and check if PBAP is successfully disconnected.

Bug: 35014213
Change-Id: I283a0cb65cb132931010fb2f8c977bea20a67951
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java
index bfa8de9..448057c 100644
--- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java
+++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java
@@ -132,7 +132,8 @@
         if (newProfileState == BluetoothProfile.STATE_CONNECTED) {
             if (profile instanceof MapProfile) {
                 profile.setPreferred(mDevice, true);
-            } else if (!mProfiles.contains(profile)) {
+            }
+            if (!mProfiles.contains(profile)) {
                 mRemovedProfiles.remove(profile);
                 mProfiles.add(profile);
                 if (profile instanceof PanProfile &&