Merge "Add support for selection of Opus in Developer Options" into tm-qpr-dev am: cb930bc0ff am: c0209a6e7a

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/17901372

Change-Id: Id5a9bd7295c995b2e653480d86c6054763766303
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Omer Osman
2022-08-04 20:03:56 +00:00
committed by Automerger Merge Worker
5 changed files with 76 additions and 8 deletions

View File

@@ -40,7 +40,11 @@ public abstract class AbstractBluetoothDialogPreferenceController extends
private static final String TAG = "AbstractBtDlgCtr";
protected static final int[] CODEC_TYPES = {BluetoothCodecConfig.SOURCE_CODEC_TYPE_LDAC,
private static final int SOURCE_CODEC_TYPE_OPUS = 6; // TODO(b/240635097): remove in U
protected static final int[] CODEC_TYPES = {SOURCE_CODEC_TYPE_OPUS,
BluetoothCodecConfig.SOURCE_CODEC_TYPE_LC3,
BluetoothCodecConfig.SOURCE_CODEC_TYPE_LDAC,
BluetoothCodecConfig.SOURCE_CODEC_TYPE_APTX_HD,
BluetoothCodecConfig.SOURCE_CODEC_TYPE_APTX,
BluetoothCodecConfig.SOURCE_CODEC_TYPE_AAC,

View File

@@ -61,6 +61,8 @@ public class BluetoothCodecDialogPreference extends BaseBluetoothDialogPreferenc
mRadioButtonIds.add(R.id.bluetooth_audio_codec_aptx);
mRadioButtonIds.add(R.id.bluetooth_audio_codec_aptx_hd);
mRadioButtonIds.add(R.id.bluetooth_audio_codec_ldac);
mRadioButtonIds.add(R.id.bluetooth_audio_codec_lc3);
mRadioButtonIds.add(R.id.bluetooth_audio_codec_opus);
String[] stringArray = context.getResources().getStringArray(
R.array.bluetooth_a2dp_codec_titles);
for (int i = 0; i < stringArray.length; i++) {

View File

@@ -40,6 +40,8 @@ public class BluetoothCodecDialogPreferenceController extends
private static final String KEY = "bluetooth_audio_codec_settings";
private static final String TAG = "BtCodecCtr";
private static final int SOURCE_CODEC_TYPE_OPUS = 6; // TODO remove in U
private final Callback mCallback;
public BluetoothCodecDialogPreferenceController(Context context, Lifecycle lifecycle,
@@ -118,6 +120,14 @@ public class BluetoothCodecDialogPreferenceController extends
codecTypeValue = BluetoothCodecConfig.SOURCE_CODEC_TYPE_LDAC;
codecPriorityValue = BluetoothCodecConfig.CODEC_PRIORITY_HIGHEST;
break;
case 6:
codecTypeValue = BluetoothCodecConfig.SOURCE_CODEC_TYPE_LC3;
codecPriorityValue = BluetoothCodecConfig.CODEC_PRIORITY_HIGHEST;
break;
case 7:
codecTypeValue = SOURCE_CODEC_TYPE_OPUS; // TODO update in U
codecPriorityValue = BluetoothCodecConfig.CODEC_PRIORITY_HIGHEST;
break;
default:
break;
}
@@ -180,6 +190,9 @@ public class BluetoothCodecDialogPreferenceController extends
case BluetoothCodecConfig.SOURCE_CODEC_TYPE_LDAC:
index = 5;
break;
case SOURCE_CODEC_TYPE_OPUS: // TODO update in U
index = 7;
break;
default:
Log.e(TAG, "Unsupported config:" + config);
break;