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

Commit 339b2e4e authored by Rahul Sabnis's avatar Rahul Sabnis Committed by Automerger Merge Worker
Browse files

Merge "Require calls to BluetoothA2dp#setBufferLengthMillis to pass a...

Merge "Require calls to BluetoothA2dp#setBufferLengthMillis to pass a non-negative value" into sc-dev am: 7a3cb23b

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15404294

Change-Id: I582acb3447a8f9aff2afa745a1ab8ab1ca5c7a33
parents 54544485 7a3cb23b
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -1025,6 +1025,10 @@ public final class BluetoothA2dp implements BluetoothProfile {
    public boolean setBufferLengthMillis(@BluetoothCodecConfig.SourceCodecType int codec,
    public boolean setBufferLengthMillis(@BluetoothCodecConfig.SourceCodecType int codec,
            int value) {
            int value) {
        if (VDBG) log("setBufferLengthMillis(" + codec + ", " + 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 {
        try {
            final IBluetoothA2dp service = getService();
            final IBluetoothA2dp service = getService();
            if (service != null && isEnabled()) {
            if (service != null && isEnabled()) {