summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEtienne Ruffieux <eruffieux@google.com>2021-11-05 10:14:49 +0000
committerEtienne Ruffieux <eruffieux@google.com>2021-11-09 11:35:57 +0000
commit5525edb35b78c03b9acfad5861d3f93954105de8 (patch)
treefd071bae5ef8be8d50497d915328d35806fe2096
parent2458191e9d1673aa2302171e696e3c46719a94da (diff)
downloadconnectivity-5525edb35b78c03b9acfad5861d3f93954105de8.tar.gz
Make BluetoothCodecConfig and BluetoothCodecStatus public.
Tag: #feature Bug: 200202780 Test: atest BluetoothInstrumentationTests Change-Id: I6f26b24f57c8812f732043c0328f62661fb600cc
-rw-r--r--PMC/src/com/android/pmc/A2dpReceiver.java20
1 files changed, 14 insertions, 6 deletions
diff --git a/PMC/src/com/android/pmc/A2dpReceiver.java b/PMC/src/com/android/pmc/A2dpReceiver.java
index 162d864..4728830 100644
--- a/PMC/src/com/android/pmc/A2dpReceiver.java
+++ b/PMC/src/com/android/pmc/A2dpReceiver.java
@@ -35,6 +35,7 @@ import android.os.SystemClock;
import android.util.Log;
import java.util.ArrayList;
+import java.util.List;
import java.util.Set;
/**
@@ -399,8 +400,8 @@ public class A2dpReceiver extends BroadcastReceiver {
private BluetoothCodecConfig getCodecValue(boolean printCapabilities) {
BluetoothCodecStatus codecStatus = null;
BluetoothCodecConfig codecConfig = null;
- BluetoothCodecConfig[] codecsLocalCapabilities = null;
- BluetoothCodecConfig[] codecsSelectableCapabilities = null;
+ List<BluetoothCodecConfig> codecsLocalCapabilities = new ArrayList<>();
+ List<BluetoothCodecConfig> codecsSelectableCapabilities = new ArrayList<>();
if (mBluetoothA2dp != null) {
BluetoothDevice activeDevice = mBluetoothA2dp.getActiveDevice();
@@ -450,10 +451,17 @@ public class A2dpReceiver extends BroadcastReceiver {
+ " bitsPerSample: " + bitsPerSample + " Channel Mode: " + channelMode
+ " LDAC quality: " + codecSpecific1);
- BluetoothCodecConfig codecConfig =
- new BluetoothCodecConfig(codecType, BluetoothCodecConfig.CODEC_PRIORITY_HIGHEST,
- sampleRate, bitsPerSample, channelMode,
- codecSpecific1, codecSpecific2, codecSpecific3, codecSpecific4);
+ BluetoothCodecConfig codecConfig = new BluetoothCodecConfig.Builder()
+ .setCodecType(codecType)
+ .setCodecPriority(BluetoothCodecConfig.CODEC_PRIORITY_HIGHEST)
+ .setSampleRate(sampleRate)
+ .setBitsPerSample(bitsPerSample)
+ .setChannelMode(channelMode)
+ .setCodecSpecific1(codecSpecific1)
+ .setCodecSpecific2(codecSpecific2)
+ .setCodecSpecific3(codecSpecific3)
+ .setCodecSpecific4(codecSpecific4)
+ .build();
// Wait here to see if mBluetoothA2dp is set
for (int i = 0; i < WAIT_SECONDS; i++) {