summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorValdikSS <iam@valdikss.org.ru>2018-09-10 02:02:50 +0300
committerRashed Abdel-Tawab <rashedabdeltawab@gmail.com>2019-05-13 19:47:26 +0200
commitcc727902eed5490defa40a2a8340a65e81784852 (patch)
tree2dd7abfa2a37ad090e5fe1be8024564c67ab99c0 /src
parent8869360f8f97715cf9d4b18416dde07855f79ca0 (diff)
downloadandroid_packages_apps_Bluetooth-cc727902eed5490defa40a2a8340a65e81784852.tar.gz
android_packages_apps_Bluetooth-cc727902eed5490defa40a2a8340a65e81784852.tar.bz2
android_packages_apps_Bluetooth-cc727902eed5490defa40a2a8340a65e81784852.zip
SBC Dual Channel (SBC HD Audio) support
"HD Audio" checkbox is not checked for SBC by default. Change-Id: Id45c48aeaa2eb86f3dffa0cc825d1e09f1c00187
Diffstat (limited to 'src')
-rw-r--r--src/com/android/bluetooth/a2dp/A2dpCodecConfig.java8
-rw-r--r--src/com/android/bluetooth/a2dp/A2dpService.java5
2 files changed, 12 insertions, 1 deletions
diff --git a/src/com/android/bluetooth/a2dp/A2dpCodecConfig.java b/src/com/android/bluetooth/a2dp/A2dpCodecConfig.java
index 4de89dfbf..373934638 100644
--- a/src/com/android/bluetooth/a2dp/A2dpCodecConfig.java
+++ b/src/com/android/bluetooth/a2dp/A2dpCodecConfig.java
@@ -69,6 +69,14 @@ class A2dpCodecConfig {
BluetoothCodecConfig codecConfig = codecConfigArray[i];
if (!codecConfig.isMandatoryCodec()) {
codecConfigArray[i] = null;
+ } else {
+ // Rebuild SBC selectable codec with Dual Channel (SBC HD audio)
+ codecConfigArray[i] = new BluetoothCodecConfig(
+ BluetoothCodecConfig.SOURCE_CODEC_TYPE_SBC, mA2dpSourceCodecPrioritySbc,
+ BluetoothCodecConfig.SAMPLE_RATE_NONE,
+ BluetoothCodecConfig.BITS_PER_SAMPLE_NONE,
+ BluetoothCodecConfig.CHANNEL_MODE_DUAL_CHANNEL, 0 /* codecSpecific1 */,
+ 0 /* codecSpecific2 */, 0 /* codecSpecific3 */, 0 /* codecSpecific4 */);
}
}
diff --git a/src/com/android/bluetooth/a2dp/A2dpService.java b/src/com/android/bluetooth/a2dp/A2dpService.java
index 0548cdd4a..d35b206ad 100644
--- a/src/com/android/bluetooth/a2dp/A2dpService.java
+++ b/src/com/android/bluetooth/a2dp/A2dpService.java
@@ -933,7 +933,10 @@ public class A2dpService extends ProfileService {
BluetoothCodecStatus codecStatus = sm.getCodecStatus();
if (codecStatus != null) {
for (BluetoothCodecConfig config : codecStatus.getCodecsSelectableCapabilities()) {
- if (!config.isMandatoryCodec()) {
+ boolean isMandatoryCodecWithDualChannel = (config.isMandatoryCodec()
+ && (config.getChannelMode() & config.CHANNEL_MODE_DUAL_CHANNEL)
+ == config.CHANNEL_MODE_DUAL_CHANNEL);
+ if (!config.isMandatoryCodec() || isMandatoryCodecWithDualChannel) {
supportsOptional = true;
break;
}