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

Commit f27784d4 authored by Rongxuan Liu's avatar Rongxuan Liu Committed by Gerrit Code Review
Browse files

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

parents b3673f19 f2058869
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)