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

Commit 81b13421 authored by Łukasz Rymanowski's avatar Łukasz Rymanowski
Browse files

LeAudioService: Remove reduntant code

Any limitation on bonded devices should be done in settings.
Without this fix, we could end up having bonded headset which would be
not able to work with LeAudio.

Bug: 324854842
Flag: Exempt, obvious fix removing unecessary limitation
Test: atest LeAudioServiceTest
Change-Id: I65592407fe254feaeca7fb50adec20a9b87e7a7c
parent aeaae719
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -111,8 +111,6 @@ public class LeAudioService extends ProfileService {
    // Timeout for state machine thread join, to prevent potential ANR.
    private static final int SM_THREAD_JOIN_TIMEOUT_MS = 1000;

    // Upper limit of all LeAudio devices: Bonded or Connected
    private static final int MAX_LE_AUDIO_DEVICES = 10;
    private static LeAudioService sLeAudioService;

    /**
@@ -572,14 +570,6 @@ public class LeAudioService extends ProfileService {
            boolean isInbandRingtoneEnabled) {
        LeAudioDeviceDescriptor descriptor = mDeviceDescriptors.get(device);
        if (descriptor == null) {

            // Limit the maximum number of devices to avoid DoS attack
            if (mDeviceDescriptors.size() >= MAX_LE_AUDIO_DEVICES) {
                Log.e(TAG, "Maximum number of LeAudio state machines reached: "
                        + MAX_LE_AUDIO_DEVICES);
                return null;
            }

            mDeviceDescriptors.put(device, new LeAudioDeviceDescriptor(isInbandRingtoneEnabled));
            descriptor = mDeviceDescriptors.get(device);
            Log.d(TAG, "Created descriptor for device: " + device);