summaryrefslogtreecommitdiff
path: root/core/java/android/bluetooth/BluetoothCodecConfig.java
diff options
context:
space:
mode:
authorPavlin Radoslavov <pavlin@google.com>2017-02-05 15:45:06 -0800
committerPavlin Radoslavov <pavlin@google.com>2017-02-06 13:07:23 -0800
commit2199339c398fb875adf25d7002049db5b64a6df4 (patch)
tree7fb9b414fd43085928090c66546ff0569ca916c0 /core/java/android/bluetooth/BluetoothCodecConfig.java
parent006065fee4f1fd088808178b9e5c688782ac1173 (diff)
Add a mechanism to configure the default A2DP codec priorities
Previously, the relative codec priorities were hard-codec internally. The new mechanism uses the following configurable resources in packages/apps/Bluetooth/res/values/config.xml to re-assign the default codec priorities per device, or to explicitly disable a codec. - a2dp_source_codec_priority_sbc - a2dp_source_codec_priority_aac - a2dp_source_codec_priority_aptx - a2dp_source_codec_priority_aptx_hd - a2dp_source_codec_priority_ldac Those values are assigned on startup. Also, they can be changed per device by using an overlay: device/<VENDOR>/<DEVICE>/overlay/packages/apps/Bluetooth/res/values/config.xml Test: Manually streaming to a headset Change-Id: Ic4da3a51ac73f00cbae731156cb7878c8fadee06
Diffstat (limited to 'core/java/android/bluetooth/BluetoothCodecConfig.java')
-rw-r--r--core/java/android/bluetooth/BluetoothCodecConfig.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/java/android/bluetooth/BluetoothCodecConfig.java b/core/java/android/bluetooth/BluetoothCodecConfig.java
index a48210340e63..176e48fb6e08 100644
--- a/core/java/android/bluetooth/BluetoothCodecConfig.java
+++ b/core/java/android/bluetooth/BluetoothCodecConfig.java
@@ -37,9 +37,11 @@ public final class BluetoothCodecConfig implements Parcelable {
public static final int SOURCE_CODEC_TYPE_APTX = 2;
public static final int SOURCE_CODEC_TYPE_APTX_HD = 3;
public static final int SOURCE_CODEC_TYPE_LDAC = 4;
+ public static final int SOURCE_CODEC_TYPE_MAX = 5;
public static final int SOURCE_CODEC_TYPE_INVALID = 1000 * 1000;
+ public static final int CODEC_PRIORITY_DISABLED = -1;
public static final int CODEC_PRIORITY_DEFAULT = 0;
public static final int CODEC_PRIORITY_HIGHEST = 1000 * 1000;
@@ -72,7 +74,7 @@ public final class BluetoothCodecConfig implements Parcelable {
public BluetoothCodecConfig(int codecType, int codecPriority,
int sampleRate, int bitsPerSample,
- int channelMode,long codecSpecific1,
+ int channelMode, long codecSpecific1,
long codecSpecific2, long codecSpecific3,
long codecSpecific4) {
mCodecType = codecType;