Merge "Require calls to BluetoothA2dp#setBufferLengthMillis to pass a non-negative value" am: cf2ef57519
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1792153 Change-Id: I400cd575b38061d02cf6def535474ce1cfa6937c
This commit is contained in:
@@ -946,6 +946,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()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user