Update BluetoothA2dp API

- Rename setBufferMillis to setBufferLengthMillis
- Rename getCodec to forCodec

Bug: 179814567
Test: Build
Change-Id: Iadb1b9e2b42ecab98f70b8bf6500e7a97aaf0aab
This commit is contained in:
More Kuo
2021-02-19 18:00:41 +08:00
parent 09bbad130d
commit d1c7af46ca
3 changed files with 7 additions and 6 deletions

View File

@@ -943,12 +943,13 @@ public final class BluetoothA2dp implements BluetoothProfile {
*/
@SystemApi
@RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED)
public boolean setBufferMillis(@BluetoothCodecConfig.SourceCodecType int codec, int value) {
if (VDBG) log("setBufferMillis(" + codec + ", " + value + ")");
public boolean setBufferLengthMillis(@BluetoothCodecConfig.SourceCodecType int codec,
int value) {
if (VDBG) log("setBufferLengthMillis(" + codec + ", " + value + ")");
try {
final IBluetoothA2dp service = getService();
if (service != null && isEnabled()) {
return service.setBufferMillis(codec, value);
return service.setBufferLengthMillis(codec, value);
}
if (service == null) Log.w(TAG, "Proxy not attached to service");
return false;

View File

@@ -90,7 +90,7 @@ public final class BufferConstraints implements Parcelable {
* @hide
*/
@SystemApi
public @Nullable BufferConstraint getCodec(@BluetoothCodecConfig.SourceCodecType int codec) {
public @Nullable BufferConstraint forCodec(@BluetoothCodecConfig.SourceCodecType int codec) {
return mBufferConstraints.get(codec);
}
}