Merge "Update Opus over A2DP to use BluetoothCodecConfig api"

This commit is contained in:
Omer Osman
2022-08-30 16:19:26 +00:00
committed by Android (Google) Code Review
3 changed files with 4 additions and 10 deletions

View File

@@ -65,8 +65,6 @@ public class AudioSystem
private static final String TAG = "AudioSystem";
private static final int SOURCE_CODEC_TYPE_OPUS = 6; // TODO remove in U
// private constructor to prevent instantiating AudioSystem
private AudioSystem() {
throw new UnsupportedOperationException("Trying to instantiate AudioSystem");
@@ -293,7 +291,7 @@ public class AudioSystem
case AUDIO_FORMAT_APTX_HD: return BluetoothCodecConfig.SOURCE_CODEC_TYPE_APTX_HD;
case AUDIO_FORMAT_LDAC: return BluetoothCodecConfig.SOURCE_CODEC_TYPE_LDAC;
case AUDIO_FORMAT_LC3: return BluetoothCodecConfig.SOURCE_CODEC_TYPE_LC3;
case AUDIO_FORMAT_OPUS: return SOURCE_CODEC_TYPE_OPUS; // TODO update in U
case AUDIO_FORMAT_OPUS: return BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS;
default:
Log.e(TAG, "Unknown audio format 0x" + Integer.toHexString(audioFormat)
+ " for conversion to BT codec");
@@ -336,7 +334,7 @@ public class AudioSystem
return AudioSystem.AUDIO_FORMAT_LDAC;
case BluetoothCodecConfig.SOURCE_CODEC_TYPE_LC3:
return AudioSystem.AUDIO_FORMAT_LC3;
case SOURCE_CODEC_TYPE_OPUS: // TODO update in U
case BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS:
return AudioSystem.AUDIO_FORMAT_OPUS;
default:
Log.e(TAG, "Unknown BT codec 0x" + Integer.toHexString(btCodec)

View File

@@ -43,8 +43,6 @@ import java.util.List;
public class A2dpProfile implements LocalBluetoothProfile {
private static final String TAG = "A2dpProfile";
private static final int SOURCE_CODEC_TYPE_OPUS = 6; // TODO remove in U
private Context mContext;
private BluetoothA2dp mService;
@@ -333,7 +331,7 @@ public class A2dpProfile implements LocalBluetoothProfile {
case BluetoothCodecConfig.SOURCE_CODEC_TYPE_LC3:
index = 6;
break;
case SOURCE_CODEC_TYPE_OPUS: // TODO update in U
case BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS:
index = 7;
break;
}

View File

@@ -53,8 +53,6 @@ public class BtHelper {
private static final String TAG = "AS.BtHelper";
private static final int SOURCE_CODEC_TYPE_OPUS = 6; // TODO remove in U
private final @NonNull AudioDeviceBroker mDeviceBroker;
BtHelper(@NonNull AudioDeviceBroker broker) {
@@ -913,7 +911,7 @@ public class BtHelper {
return "ENCODING_APTX_HD";
case BluetoothCodecConfig.SOURCE_CODEC_TYPE_LDAC:
return "ENCODING_LDAC";
case SOURCE_CODEC_TYPE_OPUS: // TODO update in U
case BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS:
return "ENCODING_OPUS";
default:
return "ENCODING_BT_CODEC_TYPE(" + btCodecType + ")";