1 /*
2  * Copyright (C) 2021 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package android.bluetooth;
18 
19 import android.annotation.FlaggedApi;
20 import android.annotation.IntDef;
21 import android.annotation.NonNull;
22 import android.annotation.Nullable;
23 import android.os.Parcel;
24 import android.os.Parcelable;
25 
26 import com.android.bluetooth.flags.Flags;
27 
28 import java.lang.annotation.Retention;
29 import java.lang.annotation.RetentionPolicy;
30 import java.util.Objects;
31 
32 /**
33  * Represents the codec configuration for a Bluetooth LE Audio source device.
34  *
35  * <p>Contains the source codec type.
36  *
37  * <p>The source codec type values are the same as those supported by the device hardware.
38  *
39  * @see BluetoothLeAudioCodecConfig
40  */
41 public final class BluetoothLeAudioCodecConfig implements Parcelable {
42     // Add an entry for each source codec here.
43 
44     /** @hide */
45     @IntDef(
46             prefix = "SOURCE_CODEC_TYPE_",
47             value = {SOURCE_CODEC_TYPE_LC3, SOURCE_CODEC_TYPE_INVALID})
48     @Retention(RetentionPolicy.SOURCE)
49     public @interface SourceCodecType {};
50 
51     public static final int SOURCE_CODEC_TYPE_LC3 = 0;
52     public static final int SOURCE_CODEC_TYPE_INVALID = 1000 * 1000;
53 
54     /** @hide */
55     @IntDef(
56             prefix = "CODEC_PRIORITY_",
57             value = {CODEC_PRIORITY_DISABLED, CODEC_PRIORITY_DEFAULT, CODEC_PRIORITY_HIGHEST})
58     @Retention(RetentionPolicy.SOURCE)
59     public @interface CodecPriority {}
60 
61     /**
62      * Codec priority disabled. Used to indicate that this codec is disabled and should not be used.
63      */
64     public static final int CODEC_PRIORITY_DISABLED = -1;
65 
66     /** Codec priority default. Default value used for codec priority. */
67     public static final int CODEC_PRIORITY_DEFAULT = 0;
68 
69     /** Codec priority highest. Used to indicate the highest priority a codec can have. */
70     public static final int CODEC_PRIORITY_HIGHEST = 1000 * 1000;
71 
72     /** @hide */
73     @IntDef(
74             flag = true,
75             prefix = "SAMPLE_RATE_",
76             value = {
77                 SAMPLE_RATE_NONE,
78                 SAMPLE_RATE_8000,
79                 SAMPLE_RATE_11025,
80                 SAMPLE_RATE_16000,
81                 SAMPLE_RATE_22050,
82                 SAMPLE_RATE_24000,
83                 SAMPLE_RATE_32000,
84                 SAMPLE_RATE_44100,
85                 SAMPLE_RATE_48000,
86                 SAMPLE_RATE_88200,
87                 SAMPLE_RATE_96000,
88                 SAMPLE_RATE_176400,
89                 SAMPLE_RATE_192000,
90                 SAMPLE_RATE_384000
91             })
92     @Retention(RetentionPolicy.SOURCE)
93     public @interface SampleRate {}
94 
95     /**
96      * Codec sample rate 0 Hz. Default value used for codec sample rate. Values are the bit mask as
97      * defined in the Bluetooth Assigned Numbers, Generic Audio, Supported_Sampling_Frequencies
98      * table.
99      */
100     public static final int SAMPLE_RATE_NONE = 0;
101 
102     /** Codec sample rate 8000 Hz. */
103     public static final int SAMPLE_RATE_8000 = 0x01 << 0;
104 
105     /** Codec sample rate 11025 Hz. */
106     @FlaggedApi(Flags.FLAG_LEAUDIO_ADD_SAMPLING_FREQUENCIES)
107     public static final int SAMPLE_RATE_11025 = 0x01 << 1;
108 
109     /** Codec sample rate 16000 Hz. */
110     public static final int SAMPLE_RATE_16000 = 0x01 << 2;
111 
112     /** Codec sample rate 22050 Hz. */
113     @FlaggedApi(Flags.FLAG_LEAUDIO_ADD_SAMPLING_FREQUENCIES)
114     public static final int SAMPLE_RATE_22050 = 0x01 << 3;
115 
116     /** Codec sample rate 24000 Hz. */
117     public static final int SAMPLE_RATE_24000 = 0x01 << 4;
118 
119     /** Codec sample rate 32000 Hz. */
120     public static final int SAMPLE_RATE_32000 = 0x01 << 5;
121 
122     /** Codec sample rate 44100 Hz. */
123     public static final int SAMPLE_RATE_44100 = 0x01 << 6;
124 
125     /** Codec sample rate 48000 Hz. */
126     public static final int SAMPLE_RATE_48000 = 0x01 << 7;
127 
128     /** Codec sample rate 88200 Hz. */
129     @FlaggedApi(Flags.FLAG_LEAUDIO_ADD_SAMPLING_FREQUENCIES)
130     public static final int SAMPLE_RATE_88200 = 0x01 << 8;
131 
132     /** Codec sample rate 96000 Hz. */
133     @FlaggedApi(Flags.FLAG_LEAUDIO_ADD_SAMPLING_FREQUENCIES)
134     public static final int SAMPLE_RATE_96000 = 0x01 << 9;
135 
136     /** Codec sample rate 176400 Hz. */
137     @FlaggedApi(Flags.FLAG_LEAUDIO_ADD_SAMPLING_FREQUENCIES)
138     public static final int SAMPLE_RATE_176400 = 0x01 << 10;
139 
140     /** Codec sample rate 192000 Hz. */
141     @FlaggedApi(Flags.FLAG_LEAUDIO_ADD_SAMPLING_FREQUENCIES)
142     public static final int SAMPLE_RATE_192000 = 0x01 << 11;
143 
144     /** Codec sample rate 384000 Hz. */
145     @FlaggedApi(Flags.FLAG_LEAUDIO_ADD_SAMPLING_FREQUENCIES)
146     public static final int SAMPLE_RATE_384000 = 0x01 << 12;
147 
148     /** @hide */
149     @IntDef(
150             flag = true,
151             prefix = "BITS_PER_SAMPLE_",
152             value = {
153                 BITS_PER_SAMPLE_NONE,
154                 BITS_PER_SAMPLE_16,
155                 BITS_PER_SAMPLE_24,
156                 BITS_PER_SAMPLE_32
157             })
158     @Retention(RetentionPolicy.SOURCE)
159     public @interface BitsPerSample {}
160 
161     /** Codec bits per sample 0. Default value of the codec bits per sample. */
162     public static final int BITS_PER_SAMPLE_NONE = 0;
163 
164     /** Codec bits per sample 16. */
165     public static final int BITS_PER_SAMPLE_16 = 0x01 << 0;
166 
167     /** Codec bits per sample 24. */
168     public static final int BITS_PER_SAMPLE_24 = 0x01 << 1;
169 
170     /** Codec bits per sample 32. */
171     public static final int BITS_PER_SAMPLE_32 = 0x01 << 3;
172 
173     /**
174      * Values are the bit mask as defined in the Bluetooth Assigned Numbers, Generic Audio,
175      * Supported_Audio_Channel_Counts table Note: We use only part of it.
176      *
177      * @hide
178      */
179     @IntDef(
180             flag = true,
181             prefix = "CHANNEL_COUNT_",
182             value = {CHANNEL_COUNT_NONE, CHANNEL_COUNT_1, CHANNEL_COUNT_2})
183     @Retention(RetentionPolicy.SOURCE)
184     public @interface ChannelCount {}
185 
186     /** Codec channel mode NONE. Default value of the codec channel mode. */
187     public static final int CHANNEL_COUNT_NONE = 0;
188 
189     /** Codec channel mode MONO. */
190     public static final int CHANNEL_COUNT_1 = 0x01 << 0;
191 
192     /** Codec channel mode STEREO. */
193     public static final int CHANNEL_COUNT_2 = 0x01 << 1;
194 
195     /**
196      * Values are the bit mask as defined in the Bluetooth Assigned Numbers, Generic Audio,
197      * Supported_Frame_Durations table
198      *
199      * @hide
200      */
201     @IntDef(
202             flag = true,
203             prefix = "FRAME_DURATION_",
204             value = {FRAME_DURATION_NONE, FRAME_DURATION_7500, FRAME_DURATION_10000})
205     @Retention(RetentionPolicy.SOURCE)
206     public @interface FrameDuration {}
207 
208     /** Frame duration 0. Default value of the frame duration. */
209     public static final int FRAME_DURATION_NONE = 0;
210 
211     /** Frame duration 7500 us. */
212     public static final int FRAME_DURATION_7500 = 0x01 << 0;
213 
214     /** Frame duration 10000 us. */
215     public static final int FRAME_DURATION_10000 = 0x01 << 1;
216 
217     private final @SourceCodecType int mCodecType;
218     private final @CodecPriority int mCodecPriority;
219     private final @SampleRate int mSampleRate;
220     private final @BitsPerSample int mBitsPerSample;
221     private final @ChannelCount int mChannelCount;
222     private final @FrameDuration int mFrameDuration;
223     private final int mOctetsPerFrame;
224     private final int mMinOctetsPerFrame;
225     private final int mMaxOctetsPerFrame;
226 
227     /**
228      * Creates a new BluetoothLeAudioCodecConfig.
229      *
230      * @param codecType the source codec type
231      * @param codecPriority the priority of this codec
232      * @param sampleRate the codec sample rate
233      * @param bitsPerSample the bits per sample of this codec
234      * @param channelCount the channel count of this codec
235      * @param frameDuration the frame duration of this codec
236      * @param octetsPerFrame the octets per frame of this codec
237      * @param minOctetsPerFrame the minimum octets per frame of this codec
238      * @param maxOctetsPerFrame the maximum octets per frame of this codec
239      */
BluetoothLeAudioCodecConfig( @ourceCodecType int codecType, @CodecPriority int codecPriority, @SampleRate int sampleRate, @BitsPerSample int bitsPerSample, @ChannelCount int channelCount, @FrameDuration int frameDuration, int octetsPerFrame, int minOctetsPerFrame, int maxOctetsPerFrame)240     private BluetoothLeAudioCodecConfig(
241             @SourceCodecType int codecType,
242             @CodecPriority int codecPriority,
243             @SampleRate int sampleRate,
244             @BitsPerSample int bitsPerSample,
245             @ChannelCount int channelCount,
246             @FrameDuration int frameDuration,
247             int octetsPerFrame,
248             int minOctetsPerFrame,
249             int maxOctetsPerFrame) {
250         mCodecType = codecType;
251         mCodecPriority = codecPriority;
252         mSampleRate = sampleRate;
253         mBitsPerSample = bitsPerSample;
254         mChannelCount = channelCount;
255         mFrameDuration = frameDuration;
256         mOctetsPerFrame = octetsPerFrame;
257         mMinOctetsPerFrame = minOctetsPerFrame;
258         mMaxOctetsPerFrame = maxOctetsPerFrame;
259     }
260 
261     @Override
describeContents()262     public int describeContents() {
263         return 0;
264     }
265 
266     /** {@link Parcelable.Creator} interface implementation. */
267     public static final @android.annotation.NonNull Parcelable.Creator<BluetoothLeAudioCodecConfig>
268             CREATOR =
269                     new Parcelable.Creator<BluetoothLeAudioCodecConfig>() {
270                         public BluetoothLeAudioCodecConfig createFromParcel(Parcel in) {
271                             int codecType = in.readInt();
272                             int codecPriority = in.readInt();
273                             int sampleRate = in.readInt();
274                             int bitsPerSample = in.readInt();
275                             int channelCount = in.readInt();
276                             int frameDuration = in.readInt();
277                             int octetsPerFrame = in.readInt();
278                             int minOctetsPerFrame = in.readInt();
279                             int maxOctetsPerFrame = in.readInt();
280                             return new BluetoothLeAudioCodecConfig(
281                                     codecType,
282                                     codecPriority,
283                                     sampleRate,
284                                     bitsPerSample,
285                                     channelCount,
286                                     frameDuration,
287                                     octetsPerFrame,
288                                     minOctetsPerFrame,
289                                     maxOctetsPerFrame);
290                         }
291 
292                         public BluetoothLeAudioCodecConfig[] newArray(int size) {
293                             return new BluetoothLeAudioCodecConfig[size];
294                         }
295                     };
296 
297     @Override
writeToParcel(@onNull Parcel out, int flags)298     public void writeToParcel(@NonNull Parcel out, int flags) {
299         out.writeInt(mCodecType);
300         out.writeInt(mCodecPriority);
301         out.writeInt(mSampleRate);
302         out.writeInt(mBitsPerSample);
303         out.writeInt(mChannelCount);
304         out.writeInt(mFrameDuration);
305         out.writeInt(mOctetsPerFrame);
306         out.writeInt(mMinOctetsPerFrame);
307         out.writeInt(mMaxOctetsPerFrame);
308     }
309 
sampleRateToString(@ampleRate int sampleRateBit)310     private String sampleRateToString(@SampleRate int sampleRateBit) {
311         switch (sampleRateBit) {
312             case SAMPLE_RATE_NONE:
313                 return "None";
314             case SAMPLE_RATE_8000:
315                 return "8 kHz";
316             case SAMPLE_RATE_11025:
317                 return "11.025 kHz";
318             case SAMPLE_RATE_16000:
319                 return "16 kHz";
320             case SAMPLE_RATE_22050:
321                 return "22.05 kHz";
322             case SAMPLE_RATE_24000:
323                 return "24 kHz";
324             case SAMPLE_RATE_32000:
325                 return "32 kHz";
326             case SAMPLE_RATE_44100:
327                 return "44.1 kHz";
328             case SAMPLE_RATE_48000:
329                 return "48 kHz";
330             case SAMPLE_RATE_88200:
331                 return "88.2 kHz";
332             case SAMPLE_RATE_96000:
333                 return "96 kHz";
334             case SAMPLE_RATE_176400:
335                 return "176.4 kHz";
336             case SAMPLE_RATE_192000:
337                 return "192 kHz";
338             case SAMPLE_RATE_384000:
339                 return "384 kHz";
340             default:
341                 return "Unknown bit " + sampleRateBit;
342         }
343     }
344 
frameDurationToString(@rameDuration int frameDurationBit)345     private String frameDurationToString(@FrameDuration int frameDurationBit) {
346         switch (frameDurationBit) {
347             case FRAME_DURATION_NONE:
348                 return "None";
349             case FRAME_DURATION_7500:
350                 return "7.5 ms";
351             case FRAME_DURATION_10000:
352                 return "10 ms";
353             default:
354                 return "Unknown bit " + frameDurationBit;
355         }
356     }
357 
358     @Override
toString()359     public String toString() {
360         return "{codecName:"
361                 + getCodecName()
362                 + ",mCodecType:"
363                 + mCodecType
364                 + ",mCodecPriority:"
365                 + mCodecPriority
366                 + ",mSampleRate:"
367                 + sampleRateToString(mSampleRate)
368                 + ",mBitsPerSample:"
369                 + mBitsPerSample
370                 + ",mChannelCountBitMask:"
371                 + mChannelCount
372                 + ",mFrameDuration:"
373                 + frameDurationToString(mFrameDuration)
374                 + ",mOctetsPerFrame:"
375                 + mOctetsPerFrame
376                 + ",mMinOctetsPerFrame:"
377                 + mMinOctetsPerFrame
378                 + ",mMaxOctetsPerFrame:"
379                 + mMaxOctetsPerFrame
380                 + "}";
381     }
382 
383     /**
384      * Gets the codec type.
385      *
386      * @return the codec type
387      */
getCodecType()388     public @SourceCodecType int getCodecType() {
389         return mCodecType;
390     }
391 
392     /**
393      * Gets the codec name.
394      *
395      * @return the codec name
396      */
getCodecName()397     public @NonNull String getCodecName() {
398         switch (mCodecType) {
399             case SOURCE_CODEC_TYPE_LC3:
400                 return "LC3";
401             case SOURCE_CODEC_TYPE_INVALID:
402                 return "INVALID CODEC";
403             default:
404                 break;
405         }
406         return "UNKNOWN CODEC(" + mCodecType + ")";
407     }
408 
409     /**
410      * Returns the codec selection priority.
411      *
412      * <p>The codec selection priority is relative to other codecs: larger value means higher
413      * priority.
414      */
getCodecPriority()415     public @CodecPriority int getCodecPriority() {
416         return mCodecPriority;
417     }
418 
419     /** Returns the codec sample rate. */
getSampleRate()420     public @SampleRate int getSampleRate() {
421         return mSampleRate;
422     }
423 
424     /** Returns the codec bits per sample. */
getBitsPerSample()425     public @BitsPerSample int getBitsPerSample() {
426         return mBitsPerSample;
427     }
428 
429     /** Returns the codec channel mode. */
getChannelCount()430     public @ChannelCount int getChannelCount() {
431         return mChannelCount;
432     }
433 
434     /** Returns the frame duration. */
getFrameDuration()435     public @FrameDuration int getFrameDuration() {
436         return mFrameDuration;
437     }
438 
439     /** Returns the octets per frame */
getOctetsPerFrame()440     public int getOctetsPerFrame() {
441         return mOctetsPerFrame;
442     }
443 
444     /** Returns the minimum octets per frame */
getMinOctetsPerFrame()445     public int getMinOctetsPerFrame() {
446         return mMinOctetsPerFrame;
447     }
448 
449     /** Returns the maximum octets per frame */
getMaxOctetsPerFrame()450     public int getMaxOctetsPerFrame() {
451         return mMaxOctetsPerFrame;
452     }
453 
454     @Override
equals(@ullable Object o)455     public boolean equals(@Nullable Object o) {
456         if (o instanceof BluetoothLeAudioCodecConfig) {
457             BluetoothLeAudioCodecConfig other = (BluetoothLeAudioCodecConfig) o;
458             return (other.getCodecType() == mCodecType
459                     && other.getCodecPriority() == mCodecPriority
460                     && other.getSampleRate() == mSampleRate
461                     && other.getBitsPerSample() == mBitsPerSample
462                     && other.getChannelCount() == mChannelCount
463                     && other.getFrameDuration() == mFrameDuration
464                     && other.getOctetsPerFrame() == mOctetsPerFrame
465                     && other.getMinOctetsPerFrame() == mMinOctetsPerFrame
466                     && other.getMaxOctetsPerFrame() == mMaxOctetsPerFrame);
467         }
468         return false;
469     }
470 
471     /**
472      * Returns a hash representation of this BluetoothLeAudioCodecConfig based on all the config
473      * values.
474      */
475     @Override
hashCode()476     public int hashCode() {
477         return Objects.hash(
478                 mCodecType,
479                 mCodecPriority,
480                 mSampleRate,
481                 mBitsPerSample,
482                 mChannelCount,
483                 mFrameDuration,
484                 mOctetsPerFrame,
485                 mMinOctetsPerFrame,
486                 mMaxOctetsPerFrame);
487     }
488 
489     /**
490      * Builder for {@link BluetoothLeAudioCodecConfig}.
491      *
492      * <p>By default, the codec type will be set to {@link
493      * BluetoothLeAudioCodecConfig#SOURCE_CODEC_TYPE_INVALID}
494      */
495     public static final class Builder {
496         private int mCodecType = BluetoothLeAudioCodecConfig.SOURCE_CODEC_TYPE_INVALID;
497         private int mCodecPriority = BluetoothLeAudioCodecConfig.CODEC_PRIORITY_DEFAULT;
498         private int mSampleRate = BluetoothLeAudioCodecConfig.SAMPLE_RATE_NONE;
499         private int mBitsPerSample = BluetoothLeAudioCodecConfig.BITS_PER_SAMPLE_NONE;
500         private int mChannelCount = BluetoothLeAudioCodecConfig.CHANNEL_COUNT_NONE;
501         private int mFrameDuration = BluetoothLeAudioCodecConfig.FRAME_DURATION_NONE;
502         private int mOctetsPerFrame = 0;
503         private int mMinOctetsPerFrame = 0;
504         private int mMaxOctetsPerFrame = 0;
505 
Builder()506         public Builder() {}
507 
Builder(@onNull BluetoothLeAudioCodecConfig config)508         public Builder(@NonNull BluetoothLeAudioCodecConfig config) {
509             mCodecType = config.getCodecType();
510             mCodecPriority = config.getCodecPriority();
511             mSampleRate = config.getSampleRate();
512             mBitsPerSample = config.getBitsPerSample();
513             mChannelCount = config.getChannelCount();
514             mFrameDuration = config.getFrameDuration();
515             mOctetsPerFrame = config.getOctetsPerFrame();
516             mMinOctetsPerFrame = config.getMinOctetsPerFrame();
517             mMaxOctetsPerFrame = config.getMaxOctetsPerFrame();
518         }
519 
520         /**
521          * Set codec type for Bluetooth LE audio codec config.
522          *
523          * @param codecType of this codec
524          * @return the same Builder instance
525          */
setCodecType(@ourceCodecType int codecType)526         public @NonNull Builder setCodecType(@SourceCodecType int codecType) {
527             mCodecType = codecType;
528             return this;
529         }
530 
531         /**
532          * Set codec priority for Bluetooth LE audio codec config.
533          *
534          * @param codecPriority of this codec
535          * @return the same Builder instance
536          */
setCodecPriority(@odecPriority int codecPriority)537         public @NonNull Builder setCodecPriority(@CodecPriority int codecPriority) {
538             mCodecPriority = codecPriority;
539             return this;
540         }
541 
542         /**
543          * Set sample rate for Bluetooth LE audio codec config.
544          *
545          * @param sampleRate of this codec
546          * @return the same Builder instance
547          */
setSampleRate(@ampleRate int sampleRate)548         public @NonNull Builder setSampleRate(@SampleRate int sampleRate) {
549             mSampleRate = sampleRate;
550             return this;
551         }
552 
553         /**
554          * Set the bits per sample for LE audio codec config.
555          *
556          * @param bitsPerSample of this codec
557          * @return the same Builder instance
558          */
setBitsPerSample(@itsPerSample int bitsPerSample)559         public @NonNull Builder setBitsPerSample(@BitsPerSample int bitsPerSample) {
560             mBitsPerSample = bitsPerSample;
561             return this;
562         }
563 
564         /**
565          * Set the channel count for Bluetooth LE audio codec config.
566          *
567          * @param channelCount of this codec
568          * @return the same Builder instance
569          */
setChannelCount(@hannelCount int channelCount)570         public @NonNull Builder setChannelCount(@ChannelCount int channelCount) {
571             mChannelCount = channelCount;
572             return this;
573         }
574 
575         /**
576          * Set the frame duration for Bluetooth LE audio codec config.
577          *
578          * @param frameDuration of this codec
579          * @return the same Builder instance
580          */
setFrameDuration(@rameDuration int frameDuration)581         public @NonNull Builder setFrameDuration(@FrameDuration int frameDuration) {
582             mFrameDuration = frameDuration;
583             return this;
584         }
585 
586         /**
587          * Set the octets per frame for Bluetooth LE audio codec config.
588          *
589          * @param octetsPerFrame of this codec
590          * @return the same Builder instance
591          */
setOctetsPerFrame(int octetsPerFrame)592         public @NonNull Builder setOctetsPerFrame(int octetsPerFrame) {
593             mOctetsPerFrame = octetsPerFrame;
594             return this;
595         }
596 
597         /**
598          * Set the minimum octets per frame for Bluetooth LE audio codec config.
599          *
600          * @param minOctetsPerFrame of this codec
601          * @return the same Builder instance
602          */
setMinOctetsPerFrame(int minOctetsPerFrame)603         public @NonNull Builder setMinOctetsPerFrame(int minOctetsPerFrame) {
604             mMinOctetsPerFrame = minOctetsPerFrame;
605             return this;
606         }
607 
608         /**
609          * Set the maximum octets per frame for Bluetooth LE audio codec config.
610          *
611          * @param maxOctetsPerFrame of this codec
612          * @return the same Builder instance
613          */
setMaxOctetsPerFrame(int maxOctetsPerFrame)614         public @NonNull Builder setMaxOctetsPerFrame(int maxOctetsPerFrame) {
615             mMaxOctetsPerFrame = maxOctetsPerFrame;
616             return this;
617         }
618 
619         /**
620          * Build {@link BluetoothLeAudioCodecConfig}.
621          *
622          * @return new BluetoothLeAudioCodecConfig built
623          */
build()624         public @NonNull BluetoothLeAudioCodecConfig build() {
625             return new BluetoothLeAudioCodecConfig(
626                     mCodecType,
627                     mCodecPriority,
628                     mSampleRate,
629                     mBitsPerSample,
630                     mChannelCount,
631                     mFrameDuration,
632                     mOctetsPerFrame,
633                     mMinOctetsPerFrame,
634                     mMaxOctetsPerFrame);
635         }
636     }
637 }
638