Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 61e1188a authored by Łukasz Rymanowski's avatar Łukasz Rymanowski Committed by Łukasz Rymanowski (xWF)
Browse files

BluetoothLeAudioCodecConfig: Add OPUS codec type for LeAudio

Bug: 378733725
Bug: 380029892
Test: mmm packages/modules/Bluetooth
Flag: com.android.bluetooth.flags.leaudio_add_opus_codec_type
Change-Id: I2fe407b9f9a7821b907617a84721837cfdb75ee6
parent 1b03899f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1003,6 +1003,7 @@ package android.bluetooth {
    field public static final int SAMPLE_RATE_NONE = 0; // 0x0
    field public static final int SOURCE_CODEC_TYPE_INVALID = 1000000; // 0xf4240
    field public static final int SOURCE_CODEC_TYPE_LC3 = 0; // 0x0
    field @FlaggedApi("com.android.bluetooth.flags.leaudio_add_opus_codec_type") public static final int SOURCE_CODEC_TYPE_OPUS = 1; // 0x1
  }

  public static final class BluetoothLeAudioCodecConfig.Builder {
+10 −1
Original line number Diff line number Diff line
@@ -44,11 +44,15 @@ public final class BluetoothLeAudioCodecConfig implements Parcelable {
    /** @hide */
    @IntDef(
            prefix = "SOURCE_CODEC_TYPE_",
            value = {SOURCE_CODEC_TYPE_LC3, SOURCE_CODEC_TYPE_INVALID})
            value = {SOURCE_CODEC_TYPE_LC3, SOURCE_CODEC_TYPE_OPUS, SOURCE_CODEC_TYPE_INVALID})
    @Retention(RetentionPolicy.SOURCE)
    public @interface SourceCodecType {};

    public static final int SOURCE_CODEC_TYPE_LC3 = 0;

    @FlaggedApi(Flags.FLAG_LEAUDIO_ADD_OPUS_CODEC_TYPE)
    public static final int SOURCE_CODEC_TYPE_OPUS = 1;

    public static final int SOURCE_CODEC_TYPE_INVALID = 1000 * 1000;

    /** @hide */
@@ -394,6 +398,11 @@ public final class BluetoothLeAudioCodecConfig implements Parcelable {
            case SOURCE_CODEC_TYPE_INVALID:
                return "INVALID CODEC";
            default:
                if (Flags.leaudioAddOpusCodecType()) {
                    if (mCodecType == SOURCE_CODEC_TYPE_OPUS) {
                        return "Opus";
                    }
                }
                break;
        }
        return "UNKNOWN CODEC(" + mCodecType + ")";