diff options
author | CNSS_WLAN Service <cnssbldsw@qualcomm.com> | 2022-02-27 22:29:17 -0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2022-02-27 22:29:17 -0800 |
commit | b14a9ca7cc80e20f8ae7269817a48046e7c7cda3 (patch) | |
tree | b1c42295157b867b9dcd7c4415a20c1f156e9317 | |
parent | b942c1fda135b29dc8673c08024307eb8558684c (diff) | |
parent | 31272a4893fd6cf578c4650ff659750f82e5a1dd (diff) |
Merge "Revert "A2DP: Fallback NS mode for HD Codec if split unsupported"" into bt-sys.lnx.12.0
-rw-r--r-- | src/com/android/bluetooth/a2dp/A2dpCodecConfig.java | 69 |
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); |