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

Commit 063511f1 authored by Rahul Sabnis's avatar Rahul Sabnis
Browse files

Require calls to BluetoothA2dp#setBufferLengthMillis to pass a

non-negative value

Tag: #feature
Bug: 194837771
Test: Manual
Change-Id: I3c1d2da1d28a494d8b393c4502521b3f0699adf6
parent fe3d6da4
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1025,6 +1025,10 @@ public final class BluetoothA2dp implements BluetoothProfile {
    public boolean setBufferLengthMillis(@BluetoothCodecConfig.SourceCodecType int codec,
            int value) {
        if (VDBG) log("setBufferLengthMillis(" + codec + ", " + value + ")");
        if (value < 0) {
            Log.e(TAG, "Trying to set audio buffer length to a negative value: " + value);
            return false;
        }
        try {
            final IBluetoothA2dp service = getService();
            if (service != null && isEnabled()) {