summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSagar Verma <quic_sagarv@quicinc.com>2022-02-20 23:56:55 -0800
committerSagar Verma <quic_sagarv@quicinc.com>2022-02-25 11:04:42 +0530
commit31272a4893fd6cf578c4650ff659750f82e5a1dd (patch)
tree695087439a291ed9f38059ddee4d53ec5845aa0a
parentc1ffb5ae4ef93f459460a0b60e79e909e0b24c89 (diff)
Revert "A2DP: Fallback NS mode for HD Codec if split unsupported"
This reverts commit 1ca4ec65850a1e404cde91c43114f8f5454a8621. Change-Id: I5a899256dc9114edf7fd878fcdd8e1c1467a3c9d
-rw-r--r--src/com/android/bluetooth/a2dp/A2dpCodecConfig.java69
1 files changed, 36 insertions, 33 deletions
diff --git a/src/com/android/bluetooth/a2dp/A2dpCodecConfig.java b/src/com/android/bluetooth/a2dp/A2dpCodecConfig.java
index 3acdddfa9..b2593cdd8 100644
--- a/src/com/android/bluetooth/a2dp/A2dpCodecConfig.java
+++ b/src/com/android/bluetooth/a2dp/A2dpCodecConfig.java
@@ -206,39 +206,6 @@ class A2dpCodecConfig {
mA2dpSourceCodecPriorityAptx = BluetoothCodecConfig.CODEC_PRIORITY_DISABLED;
}
}
-
- try {
- value = resources.getInteger(R.integer.a2dp_source_codec_priority_aptx_hd);
- } catch (NotFoundException e) {
- value = BluetoothCodecConfig.CODEC_PRIORITY_DEFAULT;
- }
- if (mAdapterService.isSplitA2DPSourceAPTXHD()) {
- if ((value >= BluetoothCodecConfig.CODEC_PRIORITY_DISABLED) && (value
- < BluetoothCodecConfig.CODEC_PRIORITY_HIGHEST)) {
- mA2dpSourceCodecPriorityAptxHd = value;
- if (a2dp_offload_cap != null && !a2dp_offload_cap.isEmpty() &&
- !a2dp_offload_cap.contains("aptxhd")) {
- mA2dpSourceCodecPriorityAptxHd = BluetoothCodecConfig.CODEC_PRIORITY_DISABLED;
- }
- }
- }
-
- try {
- value = resources.getInteger(R.integer.a2dp_source_codec_priority_ldac);
- } catch (NotFoundException e) {
- value = BluetoothCodecConfig.CODEC_PRIORITY_DEFAULT;
- }
- if(mAdapterService.isSplitA2DPSourceLDAC()) {
- if ((value >= BluetoothCodecConfig.CODEC_PRIORITY_DISABLED) && (value
- < BluetoothCodecConfig.CODEC_PRIORITY_HIGHEST)) {
- mA2dpSourceCodecPriorityLdac = value;
- if (a2dp_offload_cap != null && !a2dp_offload_cap.isEmpty() &&
- !a2dp_offload_cap.contains("ldac")) {
- mA2dpSourceCodecPriorityLdac = BluetoothCodecConfig.CODEC_PRIORITY_DISABLED;
- }
- }
- }
-
if(mAdapterService.isSplitA2DPSourceAPTXADAPTIVE()) {
try {
value = resources.getInteger(R.integer.a2dp_source_codec_priority_aptx_adaptive);
@@ -268,6 +235,42 @@ class A2dpCodecConfig {
mA2dpSourceCodecPriorityAptxAdaptive = BluetoothCodecConfig.CODEC_PRIORITY_DISABLED;
}
+ if(mAdapterService.isSplitA2DPSourceAPTXHD()) {
+ try {
+ value = resources.getInteger(R.integer.a2dp_source_codec_priority_aptx_hd);
+ } catch (NotFoundException e) {
+ value = BluetoothCodecConfig.CODEC_PRIORITY_DEFAULT;
+ }
+ if ((value >= BluetoothCodecConfig.CODEC_PRIORITY_DISABLED) && (value
+ < BluetoothCodecConfig.CODEC_PRIORITY_HIGHEST)) {
+ mA2dpSourceCodecPriorityAptxHd = value;
+ if (a2dp_offload_cap != null && !a2dp_offload_cap.isEmpty() &&
+ !a2dp_offload_cap.contains("aptxhd")) {
+ mA2dpSourceCodecPriorityAptxHd = BluetoothCodecConfig.CODEC_PRIORITY_DISABLED;
+ }
+ }
+ } else {
+ mA2dpSourceCodecPriorityAptxHd = BluetoothCodecConfig.CODEC_PRIORITY_DISABLED;
+ }
+
+
+ if(mAdapterService.isSplitA2DPSourceLDAC()) {
+ try {
+ value = resources.getInteger(R.integer.a2dp_source_codec_priority_ldac);
+ } catch (NotFoundException e) {
+ value = BluetoothCodecConfig.CODEC_PRIORITY_DEFAULT;
+ }
+ if ((value >= BluetoothCodecConfig.CODEC_PRIORITY_DISABLED) && (value
+ < BluetoothCodecConfig.CODEC_PRIORITY_HIGHEST)) {
+ mA2dpSourceCodecPriorityLdac = value;
+ if (a2dp_offload_cap != null && !a2dp_offload_cap.isEmpty() &&
+ !a2dp_offload_cap.contains("ldac")) {
+ mA2dpSourceCodecPriorityLdac = BluetoothCodecConfig.CODEC_PRIORITY_DISABLED;
+ }
+ }
+ } else {
+ mA2dpSourceCodecPriorityLdac = BluetoothCodecConfig.CODEC_PRIORITY_DISABLED;
+ }
if (mAdapterService.isVendorIntfEnabled()) {
try {
value = resources.getInteger(R.integer.a2dp_source_codec_priority_aptx_tws);