diff options
-rw-r--r-- | PMC/src/com/android/pmc/A2dpReceiver.java | 20 |
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++) { |