summaryrefslogtreecommitdiff
path: root/framework/java/android/bluetooth/BluetoothCodecConfig.java
diff options
context:
space:
mode:
authorTed Wang <tedwang@google.com>2022-01-19 14:21:18 +0800
committerTed Wang <tedwang@google.com>2022-01-19 15:42:09 +0800
commitf9ad8bde6c5ae394eb3b151760912c08f8651c72 (patch)
tree8227e9c186e3022181d7ba2693142d5aefa91fae /framework/java/android/bluetooth/BluetoothCodecConfig.java
parent913156419828cce2358fd03e4875b3f2b67d526e (diff)
Add framework support of LC3 codec
Bug: 203621600 Test: atest BluetoothCodecConfigTest Change-Id: Ibacc8b39c4d916f69befca139604ed94c627c103
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothCodecConfig.java')
-rw-r--r--framework/java/android/bluetooth/BluetoothCodecConfig.java28
1 files changed, 16 insertions, 12 deletions
diff --git a/framework/java/android/bluetooth/BluetoothCodecConfig.java b/framework/java/android/bluetooth/BluetoothCodecConfig.java
index 9a4151adff..2ee171b996 100644
--- a/framework/java/android/bluetooth/BluetoothCodecConfig.java
+++ b/framework/java/android/bluetooth/BluetoothCodecConfig.java
@@ -38,14 +38,10 @@ import java.util.Objects;
*/
public final class BluetoothCodecConfig implements Parcelable {
/** @hide */
- @IntDef(prefix = "SOURCE_CODEC_TYPE_", value = {
- SOURCE_CODEC_TYPE_SBC,
- SOURCE_CODEC_TYPE_AAC,
- SOURCE_CODEC_TYPE_APTX,
- SOURCE_CODEC_TYPE_APTX_HD,
- SOURCE_CODEC_TYPE_LDAC,
- SOURCE_CODEC_TYPE_INVALID
- })
+ @IntDef(prefix = "SOURCE_CODEC_TYPE_",
+ value = {SOURCE_CODEC_TYPE_SBC, SOURCE_CODEC_TYPE_AAC, SOURCE_CODEC_TYPE_APTX,
+ SOURCE_CODEC_TYPE_APTX_HD, SOURCE_CODEC_TYPE_LDAC, SOURCE_CODEC_TYPE_LC3,
+ SOURCE_CODEC_TYPE_INVALID})
@Retention(RetentionPolicy.SOURCE)
public @interface SourceCodecType {}
@@ -76,6 +72,11 @@ public final class BluetoothCodecConfig implements Parcelable {
public static final int SOURCE_CODEC_TYPE_LDAC = 4;
/**
+ * Source codec type LC3.
+ */
+ public static final int SOURCE_CODEC_TYPE_LC3 = 5;
+
+ /**
* Source codec type invalid. This is the default value used for codec
* type.
*/
@@ -85,7 +86,7 @@ public final class BluetoothCodecConfig implements Parcelable {
* Represents the count of valid source codec types. Can be accessed via
* {@link #getMaxCodecType}.
*/
- private static final int SOURCE_CODEC_TYPE_MAX = 5;
+ private static final int SOURCE_CODEC_TYPE_MAX = 6;
/** @hide */
@IntDef(prefix = "CODEC_PRIORITY_", value = {
@@ -460,6 +461,8 @@ public final class BluetoothCodecConfig implements Parcelable {
return "aptX HD";
case SOURCE_CODEC_TYPE_LDAC:
return "LDAC";
+ case SOURCE_CODEC_TYPE_LC3:
+ return "LC3";
case SOURCE_CODEC_TYPE_INVALID:
return "INVALID CODEC";
default:
@@ -664,9 +667,10 @@ public final class BluetoothCodecConfig implements Parcelable {
switch (mCodecType) {
case SOURCE_CODEC_TYPE_AAC:
case SOURCE_CODEC_TYPE_LDAC:
- if (mCodecSpecific1 != other.mCodecSpecific1) {
- return false;
- }
+ case SOURCE_CODEC_TYPE_LC3:
+ if (mCodecSpecific1 != other.mCodecSpecific1) {
+ return false;
+ }
default:
return true;
}