Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e4a4bfab authored by Rongxuan Liu's avatar Rongxuan Liu Committed by Automerger Merge Worker
Browse files

Merge "[le audio] Connect bass profile only if le audio profile is allowed"...

Merge "[le audio] Connect bass profile only if le audio profile is allowed" into main am: f27784d4

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/2837081



Change-Id: Ie43beb3bb6153367c934fe65d70088270849b166
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 0061d05c f27784d4
Loading
Loading
Loading
Loading
+17 −4
Original line number Diff line number Diff line
@@ -433,9 +433,11 @@ public class PhonePolicy implements AdapterService.BluetoothStateCallback {
                && Utils.arrayContains(uuids, BluetoothUuid.BASS)
                && (bcService.getConnectionPolicy(device)
                        == BluetoothProfile.CONNECTION_POLICY_UNKNOWN)) {
            if (isLeAudioProfileAllowed) {
                debugLog("setting broadcast assistant profile priority for device " + device);
                if (mAutoConnectProfilesSupported) {
                bcService.setConnectionPolicy(device, BluetoothProfile.CONNECTION_POLICY_ALLOWED);
                    bcService.setConnectionPolicy(
                            device, BluetoothProfile.CONNECTION_POLICY_ALLOWED);
                } else {
                    mAdapterService
                            .getDatabase()
@@ -444,6 +446,17 @@ public class PhonePolicy implements AdapterService.BluetoothStateCallback {
                                    BluetoothProfile.LE_AUDIO_BROADCAST_ASSISTANT,
                                    BluetoothProfile.CONNECTION_POLICY_ALLOWED);
                }
            } else {
                debugLog(
                        "clear broadcast assistant profile priority if le audio profile is not"
                                + " allowed");
                mAdapterService
                        .getDatabase()
                        .setProfileConnectionPolicy(
                                device,
                                BluetoothProfile.LE_AUDIO_BROADCAST_ASSISTANT,
                                BluetoothProfile.CONNECTION_POLICY_FORBIDDEN);
            }
        }

        if ((batteryService != null)