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

Commit 9d5816fa authored by Jack He's avatar Jack He
Browse files

PhonePolicy: Do not set LE audio priority for non-LEA device

* When LE audio profile does not exist on a device, we should not
  set its LE audio priority to forbidden

Bug: 279875784
Test: Manual
Change-Id: Ic0706c469098ae60724d508fafbfbfb0e3a873dc
parent 9d86c70c
Loading
Loading
Loading
Loading
+15 −10
Original line number Diff line number Diff line
@@ -390,6 +390,10 @@ class PhonePolicy {
            }
        }

        if ((leAudioService != null)
                && Utils.arrayContains(uuids, BluetoothUuid.LE_AUDIO)
                && (leAudioService.getConnectionPolicy(device)
                    == BluetoothProfile.CONNECTION_POLICY_UNKNOWN)) {
            if (isLeAudioProfileAllowed) {
                debugLog("setting le audio profile priority for device " + device);
                if (mAutoConnectProfilesSupported) {
@@ -400,10 +404,11 @@ class PhonePolicy {
                            BluetoothProfile.LE_AUDIO, BluetoothProfile.CONNECTION_POLICY_ALLOWED);
                }
            } else {
            debugLog("clear LEA profile priority because dual mode is disabled by default");
                debugLog("clear LEA profile priority because LE audio is not allowed");
                mAdapterService.getDatabase().setProfileConnectionPolicy(device,
                        BluetoothProfile.LE_AUDIO, BluetoothProfile.CONNECTION_POLICY_FORBIDDEN);
            }
        }

        if ((hearingAidService != null)
                && Utils.arrayContains(uuids, BluetoothUuid.HEARING_AID)