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

Commit c74e4ddc authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "LeAudioService: Remove reduntant code" into main

parents e3a95533 81b13421
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);