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

Commit 0fc53d6c authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge changes I2fe407b9,Ia4c09787 into main

* changes:
  BluetoothLeAudioCodecConfig: Add OPUS codec type for LeAudio
  flags: Add leaudio_add_opus_codec_type
parents 4ce52001 61e1188a
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -454,3 +454,11 @@ flag {
        purpose: PURPOSE_BUGFIX
    }
}

flag {
    name: "leaudio_add_opus_codec_type"
    is_exported: true
    namespace: "bluetooth"
    description: "Add OPUS codec type"
    bug: "380029892"
}
 No newline at end of file
+1 −0
Original line number Diff line number Diff line
@@ -1004,6 +1004,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 + ")";