• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2014 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.media;
18 
19 import android.Manifest;
20 import android.annotation.IntDef;
21 import android.annotation.NonNull;
22 import android.annotation.RequiresPermission;
23 import android.annotation.TestApi;
24 import android.util.SparseIntArray;
25 
26 import java.lang.annotation.Retention;
27 import java.lang.annotation.RetentionPolicy;
28 import java.util.List;
29 import java.util.Objects;
30 import java.util.TreeSet;
31 
32 /**
33  * Provides information about an audio device.
34  */
35 public final class AudioDeviceInfo {
36 
37     /**
38      * A device type associated with an unknown or uninitialized device.
39      */
40     public static final int TYPE_UNKNOWN          = 0;
41     /**
42      * A device type describing the attached earphone speaker.
43      */
44     public static final int TYPE_BUILTIN_EARPIECE = 1;
45     /**
46      * A device type describing the speaker system (i.e. a mono speaker or stereo speakers) built
47      * in a device.
48      */
49     public static final int TYPE_BUILTIN_SPEAKER  = 2;
50     /**
51      * A device type describing a headset, which is the combination of a headphones and microphone.
52      */
53     public static final int TYPE_WIRED_HEADSET    = 3;
54     /**
55      * A device type describing a pair of wired headphones.
56      */
57     public static final int TYPE_WIRED_HEADPHONES = 4;
58     /**
59      * A device type describing an analog line-level connection.
60      */
61     public static final int TYPE_LINE_ANALOG      = 5;
62     /**
63      * A device type describing a digital line connection (e.g. SPDIF).
64      */
65     public static final int TYPE_LINE_DIGITAL     = 6;
66     /**
67      * A device type describing a Bluetooth device typically used for telephony.
68      */
69     public static final int TYPE_BLUETOOTH_SCO    = 7;
70     /**
71      * A device type describing a Bluetooth device supporting the A2DP profile.
72      */
73     public static final int TYPE_BLUETOOTH_A2DP   = 8;
74     /**
75      * A device type describing an HDMI connection .
76      */
77     public static final int TYPE_HDMI             = 9;
78     /**
79      * A device type describing the Audio Return Channel of an HDMI connection.
80      */
81     public static final int TYPE_HDMI_ARC         = 10;
82     /**
83      * A device type describing a USB audio device.
84      */
85     public static final int TYPE_USB_DEVICE       = 11;
86     /**
87      * A device type describing a USB audio device in accessory mode.
88      */
89     public static final int TYPE_USB_ACCESSORY    = 12;
90     /**
91      * A device type describing the audio device associated with a dock.
92      */
93     public static final int TYPE_DOCK             = 13;
94     /**
95      * A device type associated with the transmission of audio signals over FM.
96      */
97     public static final int TYPE_FM               = 14;
98     /**
99      * A device type describing the microphone(s) built in a device.
100      */
101     public static final int TYPE_BUILTIN_MIC      = 15;
102     /**
103      * A device type for accessing the audio content transmitted over FM.
104      */
105     public static final int TYPE_FM_TUNER         = 16;
106     /**
107      * A device type for accessing the audio content transmitted over the TV tuner system.
108      */
109     public static final int TYPE_TV_TUNER         = 17;
110     /**
111      * A device type describing the transmission of audio signals over the telephony network.
112      */
113     public static final int TYPE_TELEPHONY        = 18;
114     /**
115      * A device type describing the auxiliary line-level connectors.
116      */
117     public static final int TYPE_AUX_LINE         = 19;
118     /**
119      * A device type connected over IP.
120      */
121     public static final int TYPE_IP               = 20;
122     /**
123      * A type-agnostic device used for communication with external audio systems
124      */
125     public static final int TYPE_BUS              = 21;
126     /**
127      * A device type describing a USB audio headset.
128      */
129     public static final int TYPE_USB_HEADSET       = 22;
130     /**
131      * A device type describing a Hearing Aid.
132      */
133     public static final int TYPE_HEARING_AID   = 23;
134     /**
135      * A device type describing the speaker system (i.e. a mono speaker or stereo speakers) built
136      * in a device, that is specifically tuned for outputting sounds like notifications and alarms
137      * (i.e. sounds the user couldn't necessarily anticipate).
138      * <p>Note that this physical audio device may be the same as {@link #TYPE_BUILTIN_SPEAKER}
139      * but is driven differently to safely accommodate the different use case.</p>
140      */
141     public static final int TYPE_BUILTIN_SPEAKER_SAFE = 24;
142     /**
143      * A device type for rerouting audio within the Android framework between mixes and
144      * system applications.
145      * This type is for instance encountered when querying the output device of a track
146      * (with {@link AudioTrack#getRoutedDevice()} playing from a device in screen mirroring mode,
147      * where the audio is not heard on the device, but on the remote device.
148      */
149     // Typically created when using
150     // {@link android.media.audiopolicy.AudioPolicy} for mixes created with the
151     // {@link android.media.audiopolicy.AudioMix#ROUTE_FLAG_LOOP_BACK} flag.
152     public static final int TYPE_REMOTE_SUBMIX = 25;
153 
154     /**
155      * A device type describing a Bluetooth Low Energy (BLE) audio headset or headphones.
156      * Headphones are grouped with headsets when the device is a sink:
157      * the features of headsets and headphones with regard to playback are the same.
158      */
159     public static final int TYPE_BLE_HEADSET   = 26;
160 
161     /**
162      * A device type describing a Bluetooth Low Energy (BLE) audio speaker.
163      */
164     public static final int TYPE_BLE_SPEAKER   = 27;
165 
166     /**
167      * A device type describing an Echo Canceller loopback Reference.
168      * This device is only used when capturing with MediaRecorder.AudioSource.ECHO_REFERENCE,
169      * which requires privileged permission
170      * {@link android.Manifest.permission#CAPTURE_AUDIO_OUTPUT}.
171      * @hide */
172     @RequiresPermission(Manifest.permission.CAPTURE_AUDIO_OUTPUT)
173     public static final int TYPE_ECHO_REFERENCE   = 28;
174 
175     /**
176      * A device type describing the Enhanced Audio Return Channel of an HDMI connection.
177      */
178     public static final int TYPE_HDMI_EARC         = 29;
179 
180     /**
181      * A device type describing a Bluetooth Low Energy (BLE) broadcast group.
182      */
183     public static final int TYPE_BLE_BROADCAST   = 30;
184 
185     /** @hide */
186     @IntDef(flag = false, prefix = "TYPE", value = {
187             TYPE_BUILTIN_EARPIECE,
188             TYPE_BUILTIN_SPEAKER,
189             TYPE_WIRED_HEADSET,
190             TYPE_WIRED_HEADPHONES,
191             TYPE_BLUETOOTH_SCO,
192             TYPE_BLUETOOTH_A2DP,
193             TYPE_HDMI,
194             TYPE_DOCK,
195             TYPE_USB_ACCESSORY,
196             TYPE_USB_DEVICE,
197             TYPE_USB_HEADSET,
198             TYPE_TELEPHONY,
199             TYPE_LINE_ANALOG,
200             TYPE_HDMI_ARC,
201             TYPE_HDMI_EARC,
202             TYPE_LINE_DIGITAL,
203             TYPE_FM,
204             TYPE_AUX_LINE,
205             TYPE_IP,
206             TYPE_BUS,
207             TYPE_HEARING_AID,
208             TYPE_BUILTIN_MIC,
209             TYPE_FM_TUNER,
210             TYPE_TV_TUNER,
211             TYPE_BUILTIN_SPEAKER_SAFE,
212             TYPE_REMOTE_SUBMIX,
213             TYPE_BLE_HEADSET,
214             TYPE_BLE_SPEAKER,
215             TYPE_ECHO_REFERENCE,
216             TYPE_BLE_BROADCAST}
217     )
218     @Retention(RetentionPolicy.SOURCE)
219     public @interface AudioDeviceType {}
220 
221     /** @hide */
222     @IntDef(flag = false, prefix = "TYPE", value = {
223             TYPE_BUILTIN_MIC,
224             TYPE_BLUETOOTH_SCO,
225             TYPE_BLUETOOTH_A2DP,
226             TYPE_WIRED_HEADSET,
227             TYPE_HDMI,
228             TYPE_TELEPHONY,
229             TYPE_DOCK,
230             TYPE_USB_ACCESSORY,
231             TYPE_USB_DEVICE,
232             TYPE_USB_HEADSET,
233             TYPE_FM_TUNER,
234             TYPE_TV_TUNER,
235             TYPE_LINE_ANALOG,
236             TYPE_LINE_DIGITAL,
237             TYPE_IP,
238             TYPE_BUS,
239             TYPE_REMOTE_SUBMIX,
240             TYPE_BLE_HEADSET,
241             TYPE_HDMI_ARC,
242             TYPE_HDMI_EARC,
243             TYPE_ECHO_REFERENCE}
244     )
245     @Retention(RetentionPolicy.SOURCE)
246     public @interface AudioDeviceTypeIn {}
247 
248     /** @hide */
249     @IntDef(flag = false, prefix = "TYPE", value = {
250             TYPE_BUILTIN_EARPIECE,
251             TYPE_BUILTIN_SPEAKER,
252             TYPE_WIRED_HEADSET,
253             TYPE_WIRED_HEADPHONES,
254             TYPE_BLUETOOTH_SCO,
255             TYPE_BLUETOOTH_A2DP,
256             TYPE_HDMI,
257             TYPE_DOCK,
258             TYPE_USB_ACCESSORY,
259             TYPE_USB_DEVICE,
260             TYPE_USB_HEADSET,
261             TYPE_TELEPHONY,
262             TYPE_LINE_ANALOG,
263             TYPE_HDMI_ARC,
264             TYPE_HDMI_EARC,
265             TYPE_LINE_DIGITAL,
266             TYPE_FM,
267             TYPE_AUX_LINE,
268             TYPE_IP,
269             TYPE_BUS,
270             TYPE_HEARING_AID,
271             TYPE_BUILTIN_SPEAKER_SAFE,
272             TYPE_BLE_HEADSET,
273             TYPE_BLE_SPEAKER,
274             TYPE_BLE_BROADCAST}
275     )
276     @Retention(RetentionPolicy.SOURCE)
277     public @interface AudioDeviceTypeOut {}
278 
279     /** @hide */
isValidAudioDeviceTypeOut(int type)280     /*package*/ static boolean isValidAudioDeviceTypeOut(int type) {
281         switch (type) {
282             case TYPE_BUILTIN_EARPIECE:
283             case TYPE_BUILTIN_SPEAKER:
284             case TYPE_WIRED_HEADSET:
285             case TYPE_WIRED_HEADPHONES:
286             case TYPE_BLUETOOTH_SCO:
287             case TYPE_BLUETOOTH_A2DP:
288             case TYPE_HDMI:
289             case TYPE_DOCK:
290             case TYPE_USB_ACCESSORY:
291             case TYPE_USB_DEVICE:
292             case TYPE_USB_HEADSET:
293             case TYPE_TELEPHONY:
294             case TYPE_LINE_ANALOG:
295             case TYPE_HDMI_ARC:
296             case TYPE_HDMI_EARC:
297             case TYPE_LINE_DIGITAL:
298             case TYPE_FM:
299             case TYPE_AUX_LINE:
300             case TYPE_IP:
301             case TYPE_BUS:
302             case TYPE_HEARING_AID:
303             case TYPE_BUILTIN_SPEAKER_SAFE:
304             case TYPE_BLE_HEADSET:
305             case TYPE_BLE_SPEAKER:
306             case TYPE_BLE_BROADCAST:
307                 return true;
308             default:
309                 return false;
310         }
311     }
312 
313     /** @hide */
isValidAudioDeviceTypeIn(int type)314     /*package*/ static boolean isValidAudioDeviceTypeIn(int type) {
315         switch (type) {
316             case TYPE_BUILTIN_MIC:
317             case TYPE_BLUETOOTH_SCO:
318             case TYPE_BLUETOOTH_A2DP:
319             case TYPE_WIRED_HEADSET:
320             case TYPE_HDMI:
321             case TYPE_TELEPHONY:
322             case TYPE_DOCK:
323             case TYPE_USB_ACCESSORY:
324             case TYPE_USB_DEVICE:
325             case TYPE_USB_HEADSET:
326             case TYPE_FM_TUNER:
327             case TYPE_TV_TUNER:
328             case TYPE_LINE_ANALOG:
329             case TYPE_LINE_DIGITAL:
330             case TYPE_IP:
331             case TYPE_BUS:
332             case TYPE_REMOTE_SUBMIX:
333             case TYPE_BLE_HEADSET:
334             case TYPE_HDMI_ARC:
335             case TYPE_HDMI_EARC:
336             case TYPE_ECHO_REFERENCE:
337                 return true;
338             default:
339                 return false;
340         }
341     }
342 
343     /**
344      * @hide
345      * Enforces whether the audio device type is acceptable for output.
346      *
347      * A vendor implemented output type should modify isValidAudioDeviceTypeOut()
348      * appropriately to accept the new type.  Do not remove already acceptable types.
349      *
350      * @throws IllegalArgumentException on an invalid output device type.
351      * @param type
352      */
353     @TestApi
enforceValidAudioDeviceTypeOut(int type)354     public static void enforceValidAudioDeviceTypeOut(int type) {
355         if (!isValidAudioDeviceTypeOut(type)) {
356             throw new IllegalArgumentException("Illegal output device type " + type);
357         }
358     }
359 
360     /**
361      * @hide
362      * Enforces whether the audio device type is acceptable for input.
363      *
364      * A vendor implemented input type should modify isValidAudioDeviceTypeIn()
365      * appropriately to accept the new type.  Do not remove already acceptable types.
366      *
367      * @throws IllegalArgumentException on an invalid input device type.
368      * @param type
369      */
370     @TestApi
enforceValidAudioDeviceTypeIn(int type)371     public static void enforceValidAudioDeviceTypeIn(int type) {
372         if (!isValidAudioDeviceTypeIn(type)) {
373             throw new IllegalArgumentException("Illegal input device type " + type);
374         }
375     }
376 
377     @Override
equals(Object o)378     public boolean equals(Object o) {
379         if (this == o) return true;
380         if (o == null || getClass() != o.getClass()) return false;
381         AudioDeviceInfo that = (AudioDeviceInfo) o;
382         return Objects.equals(getPort(), that.getPort());
383     }
384 
385     @Override
hashCode()386     public int hashCode() {
387         return Objects.hash(getPort());
388     }
389 
390     private final AudioDevicePort mPort;
391 
AudioDeviceInfo(AudioDevicePort port)392     AudioDeviceInfo(AudioDevicePort port) {
393        mPort = port;
394     }
395 
396     /**
397      * @hide
398      * @return The underlying {@link AudioDevicePort} instance.
399      */
getPort()400     public AudioDevicePort getPort() {
401         return mPort;
402     }
403 
404     /**
405      * @hide
406      * @return the internal device type
407      */
getInternalType()408     public int getInternalType() {
409         return mPort.type();
410     }
411 
412     /**
413      * @return The internal device ID.
414      */
getId()415     public int getId() {
416         return mPort.handle().id();
417     }
418 
419     /**
420      * @return The human-readable name of the audio device.
421      */
getProductName()422     public CharSequence getProductName() {
423         String portName = mPort.name();
424         return (portName != null && portName.length() != 0) ? portName : android.os.Build.MODEL;
425     }
426 
427     /**
428      * @return The "address" string of the device. This generally contains device-specific
429      * parameters.
430      */
getAddress()431     public @NonNull String getAddress() {
432         return mPort.address();
433     }
434 
435    /**
436      * @return true if the audio device is a source for audio data (e.e an input).
437      */
isSource()438     public boolean isSource() {
439         return mPort.role() == AudioPort.ROLE_SOURCE;
440     }
441 
442     /**
443      * @return true if the audio device is a sink for audio data (i.e. an output).
444      */
isSink()445     public boolean isSink() {
446         return mPort.role() == AudioPort.ROLE_SINK;
447     }
448 
449     /**
450      * @return An array of sample rates supported by the audio device.
451      *
452      * Note: an empty array indicates that the device supports arbitrary rates.
453      */
getSampleRates()454     public @NonNull int[] getSampleRates() {
455         return mPort.samplingRates();
456     }
457 
458     /**
459      * @return An array of channel position masks (e.g. {@link AudioFormat#CHANNEL_IN_STEREO},
460      * {@link AudioFormat#CHANNEL_OUT_7POINT1}) for which this audio device can be configured.
461      *
462      * @see AudioFormat
463      *
464      * Note: an empty array indicates that the device supports arbitrary channel masks.
465      */
getChannelMasks()466     public @NonNull int[] getChannelMasks() {
467         return mPort.channelMasks();
468     }
469 
470     /**
471      * @return An array of channel index masks for which this audio device can be configured.
472      *
473      * @see AudioFormat
474      *
475      * Note: an empty array indicates that the device supports arbitrary channel index masks.
476      */
getChannelIndexMasks()477     public @NonNull int[] getChannelIndexMasks() {
478         return mPort.channelIndexMasks();
479     }
480 
481     /**
482      * @return An array of channel counts (1, 2, 4, ...) for which this audio device
483      * can be configured.
484      *
485      * Note: an empty array indicates that the device supports arbitrary channel counts.
486      */
getChannelCounts()487     public @NonNull int[] getChannelCounts() {
488         TreeSet<Integer> countSet = new TreeSet<Integer>();
489 
490         // Channel Masks
491         for (int mask : getChannelMasks()) {
492             countSet.add(isSink() ?
493                     AudioFormat.channelCountFromOutChannelMask(mask)
494                     : AudioFormat.channelCountFromInChannelMask(mask));
495         }
496 
497         // Index Masks
498         for (int index_mask : getChannelIndexMasks()) {
499             countSet.add(Integer.bitCount(index_mask));
500         }
501 
502         int[] counts = new int[countSet.size()];
503         int index = 0;
504         for (int count : countSet) {
505             counts[index++] = count;
506         }
507         return counts;
508     }
509 
510     /**
511      * @return An array of audio encodings (e.g. {@link AudioFormat#ENCODING_PCM_16BIT},
512      * {@link AudioFormat#ENCODING_PCM_FLOAT}) supported by the audio device.
513      * <code>ENCODING_PCM_FLOAT</code> indicates the device supports more
514      * than 16 bits of integer precision.  As there is no AudioFormat constant
515      * specifically defined for 24-bit PCM, the value <code>ENCODING_PCM_FLOAT</code>
516      * indicates that {@link AudioTrack} or {@link AudioRecord} can preserve at least 24 bits of
517      * integer precision to that device.
518      *
519      * @see AudioFormat
520      *
521      * Note: an empty array indicates that the device supports arbitrary encodings.
522      * For forward compatibility, applications should ignore entries it does not recognize.
523      */
getEncodings()524     public @NonNull int[] getEncodings() {
525         return AudioFormat.filterPublicFormats(mPort.formats());
526     }
527 
528     /**
529      * @return A list of {@link AudioProfile} supported by the audio devices.
530      */
getAudioProfiles()531     public @NonNull List<AudioProfile> getAudioProfiles() {
532         return mPort.profiles();
533     }
534 
535     /**
536      * @return A list of {@link AudioDescriptor} supported by the audio devices.
537      */
getAudioDescriptors()538     public @NonNull List<AudioDescriptor> getAudioDescriptors() {
539         return mPort.audioDescriptors();
540     }
541 
542     /**
543      * Returns an array of supported encapsulation modes for the device.
544      *
545      * The array can include any of the {@code AudioTrack} encapsulation modes,
546      * e.g. {@link AudioTrack#ENCAPSULATION_MODE_ELEMENTARY_STREAM}.
547      *
548      * @return An array of supported encapsulation modes for the device.  This
549      *     may be an empty array if no encapsulation modes are supported.
550      */
getEncapsulationModes()551     public @NonNull @AudioTrack.EncapsulationMode int[] getEncapsulationModes() {
552         return mPort.encapsulationModes();
553     }
554 
555     /**
556      * Returns an array of supported encapsulation metadata types for the device.
557      *
558      * The metadata type returned should be allowed for all encapsulation modes supported
559      * by the device.  Some metadata types may apply only to certain
560      * compressed stream formats, the returned list is the union of subsets.
561      *
562      * The array can include any of
563      * {@link AudioTrack#ENCAPSULATION_METADATA_TYPE_FRAMEWORK_TUNER},
564      * {@link AudioTrack#ENCAPSULATION_METADATA_TYPE_DVB_AD_DESCRIPTOR}.
565      *
566      * @return An array of supported encapsulation metadata types for the device.  This
567      *     may be an empty array if no metadata types are supported.
568      */
getEncapsulationMetadataTypes()569     public @NonNull @AudioTrack.EncapsulationMetadataType int[] getEncapsulationMetadataTypes() {
570         return mPort.encapsulationMetadataTypes();
571     }
572 
573    /**
574      * @return The device type identifier of the audio device (i.e. TYPE_BUILTIN_SPEAKER).
575      */
getType()576     public int getType() {
577         return INT_TO_EXT_DEVICE_MAPPING.get(mPort.type(), TYPE_UNKNOWN);
578     }
579 
580     /** @hide */
convertDeviceTypeToInternalDevice(int deviceType)581     public static int convertDeviceTypeToInternalDevice(int deviceType) {
582         return EXT_TO_INT_DEVICE_MAPPING.get(deviceType, AudioSystem.DEVICE_NONE);
583     }
584 
585     /** @hide */
convertInternalDeviceToDeviceType(int intDevice)586     public static int convertInternalDeviceToDeviceType(int intDevice) {
587         return INT_TO_EXT_DEVICE_MAPPING.get(intDevice, TYPE_UNKNOWN);
588     }
589 
590     /** @hide */
convertDeviceTypeToInternalInputDevice(int deviceType)591     public static int convertDeviceTypeToInternalInputDevice(int deviceType) {
592         return convertDeviceTypeToInternalInputDevice(deviceType, "");
593     }
594     /** @hide */
convertDeviceTypeToInternalInputDevice(int deviceType, String address)595     public static int convertDeviceTypeToInternalInputDevice(int deviceType, String address) {
596         int internalType = EXT_TO_INT_INPUT_DEVICE_MAPPING.get(deviceType, AudioSystem.DEVICE_NONE);
597         if (internalType == AudioSystem.DEVICE_IN_BUILTIN_MIC
598                 && "back".equals(address)) {
599             internalType = AudioSystem.DEVICE_IN_BACK_MIC;
600         }
601         return internalType;
602     }
603 
604     private static final SparseIntArray INT_TO_EXT_DEVICE_MAPPING;
605 
606     private static final SparseIntArray EXT_TO_INT_DEVICE_MAPPING;
607 
608     /**
609      * EXT_TO_INT_INPUT_DEVICE_MAPPING aims at mapping external device type to internal input device
610      * type.
611      */
612     private static final SparseIntArray EXT_TO_INT_INPUT_DEVICE_MAPPING;
613 
614     static {
615         INT_TO_EXT_DEVICE_MAPPING = new SparseIntArray();
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_EARPIECE, TYPE_BUILTIN_EARPIECE)616         INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_EARPIECE, TYPE_BUILTIN_EARPIECE);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_SPEAKER, TYPE_BUILTIN_SPEAKER)617         INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_SPEAKER, TYPE_BUILTIN_SPEAKER);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_WIRED_HEADSET, TYPE_WIRED_HEADSET)618         INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_WIRED_HEADSET, TYPE_WIRED_HEADSET);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_WIRED_HEADPHONE, TYPE_WIRED_HEADPHONES)619         INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_WIRED_HEADPHONE, TYPE_WIRED_HEADPHONES);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_BLUETOOTH_SCO, TYPE_BLUETOOTH_SCO)620         INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_BLUETOOTH_SCO, TYPE_BLUETOOTH_SCO);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_BLUETOOTH_SCO_HEADSET, TYPE_BLUETOOTH_SCO)621         INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_BLUETOOTH_SCO_HEADSET, TYPE_BLUETOOTH_SCO);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_BLUETOOTH_SCO_CARKIT, TYPE_BLUETOOTH_SCO)622         INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_BLUETOOTH_SCO_CARKIT, TYPE_BLUETOOTH_SCO);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP, TYPE_BLUETOOTH_A2DP)623         INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP, TYPE_BLUETOOTH_A2DP);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES, TYPE_BLUETOOTH_A2DP)624         INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES, TYPE_BLUETOOTH_A2DP);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER, TYPE_BLUETOOTH_A2DP)625         INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER, TYPE_BLUETOOTH_A2DP);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_HDMI, TYPE_HDMI)626         INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_HDMI, TYPE_HDMI);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_DGTL_DOCK_HEADSET, TYPE_DOCK)627         INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_DGTL_DOCK_HEADSET, TYPE_DOCK);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_USB_ACCESSORY, TYPE_USB_ACCESSORY)628         INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_USB_ACCESSORY, TYPE_USB_ACCESSORY);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_USB_DEVICE, TYPE_USB_DEVICE)629         INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_USB_DEVICE, TYPE_USB_DEVICE);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_USB_HEADSET, TYPE_USB_HEADSET)630         INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_USB_HEADSET, TYPE_USB_HEADSET);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_TELEPHONY_TX, TYPE_TELEPHONY)631         INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_TELEPHONY_TX, TYPE_TELEPHONY);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_LINE, TYPE_LINE_ANALOG)632         INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_LINE, TYPE_LINE_ANALOG);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_HDMI_ARC, TYPE_HDMI_ARC)633         INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_HDMI_ARC, TYPE_HDMI_ARC);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_HDMI_EARC, TYPE_HDMI_EARC)634         INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_HDMI_EARC, TYPE_HDMI_EARC);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_SPDIF, TYPE_LINE_DIGITAL)635         INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_SPDIF, TYPE_LINE_DIGITAL);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_FM, TYPE_FM)636         INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_FM, TYPE_FM);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_AUX_LINE, TYPE_AUX_LINE)637         INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_AUX_LINE, TYPE_AUX_LINE);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_IP, TYPE_IP)638         INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_IP, TYPE_IP);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_BUS, TYPE_BUS)639         INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_BUS, TYPE_BUS);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_HEARING_AID, TYPE_HEARING_AID)640         INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_HEARING_AID, TYPE_HEARING_AID);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_SPEAKER_SAFE, TYPE_BUILTIN_SPEAKER_SAFE)641         INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_SPEAKER_SAFE,
642                 TYPE_BUILTIN_SPEAKER_SAFE);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_REMOTE_SUBMIX, TYPE_REMOTE_SUBMIX)643         INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_REMOTE_SUBMIX, TYPE_REMOTE_SUBMIX);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_BLE_HEADSET, TYPE_BLE_HEADSET)644         INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_BLE_HEADSET, TYPE_BLE_HEADSET);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_BLE_SPEAKER, TYPE_BLE_SPEAKER)645         INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_BLE_SPEAKER, TYPE_BLE_SPEAKER);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_BLE_BROADCAST, TYPE_BLE_BROADCAST)646         INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_BLE_BROADCAST, TYPE_BLE_BROADCAST);
647 
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_BUILTIN_MIC, TYPE_BUILTIN_MIC)648         INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_BUILTIN_MIC, TYPE_BUILTIN_MIC);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_BLUETOOTH_SCO_HEADSET, TYPE_BLUETOOTH_SCO)649         INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_BLUETOOTH_SCO_HEADSET, TYPE_BLUETOOTH_SCO);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_WIRED_HEADSET, TYPE_WIRED_HEADSET)650         INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_WIRED_HEADSET, TYPE_WIRED_HEADSET);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_HDMI, TYPE_HDMI)651         INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_HDMI, TYPE_HDMI);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_TELEPHONY_RX, TYPE_TELEPHONY)652         INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_TELEPHONY_RX, TYPE_TELEPHONY);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_BACK_MIC, TYPE_BUILTIN_MIC)653         INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_BACK_MIC, TYPE_BUILTIN_MIC);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_DGTL_DOCK_HEADSET, TYPE_DOCK)654         INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_DGTL_DOCK_HEADSET, TYPE_DOCK);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_USB_ACCESSORY, TYPE_USB_ACCESSORY)655         INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_USB_ACCESSORY, TYPE_USB_ACCESSORY);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_USB_DEVICE, TYPE_USB_DEVICE)656         INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_USB_DEVICE, TYPE_USB_DEVICE);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_USB_HEADSET, TYPE_USB_HEADSET)657         INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_USB_HEADSET, TYPE_USB_HEADSET);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_FM_TUNER, TYPE_FM_TUNER)658         INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_FM_TUNER, TYPE_FM_TUNER);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_TV_TUNER, TYPE_TV_TUNER)659         INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_TV_TUNER, TYPE_TV_TUNER);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_LINE, TYPE_LINE_ANALOG)660         INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_LINE, TYPE_LINE_ANALOG);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_SPDIF, TYPE_LINE_DIGITAL)661         INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_SPDIF, TYPE_LINE_DIGITAL);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_BLUETOOTH_A2DP, TYPE_BLUETOOTH_A2DP)662         INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_BLUETOOTH_A2DP, TYPE_BLUETOOTH_A2DP);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_IP, TYPE_IP)663         INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_IP, TYPE_IP);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_BUS, TYPE_BUS)664         INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_BUS, TYPE_BUS);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_REMOTE_SUBMIX, TYPE_REMOTE_SUBMIX)665         INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_REMOTE_SUBMIX, TYPE_REMOTE_SUBMIX);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_BLE_HEADSET, TYPE_BLE_HEADSET)666         INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_BLE_HEADSET, TYPE_BLE_HEADSET);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_HDMI_ARC, TYPE_HDMI_ARC)667         INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_HDMI_ARC, TYPE_HDMI_ARC);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_HDMI_EARC, TYPE_HDMI_EARC)668         INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_HDMI_EARC, TYPE_HDMI_EARC);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_ECHO_REFERENCE, TYPE_ECHO_REFERENCE)669         INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_ECHO_REFERENCE, TYPE_ECHO_REFERENCE);
670 
671 
672         // privileges mapping to output device
673         EXT_TO_INT_DEVICE_MAPPING = new SparseIntArray();
EXT_TO_INT_DEVICE_MAPPING.put(TYPE_BUILTIN_EARPIECE, AudioSystem.DEVICE_OUT_EARPIECE)674         EXT_TO_INT_DEVICE_MAPPING.put(TYPE_BUILTIN_EARPIECE, AudioSystem.DEVICE_OUT_EARPIECE);
EXT_TO_INT_DEVICE_MAPPING.put(TYPE_BUILTIN_SPEAKER, AudioSystem.DEVICE_OUT_SPEAKER)675         EXT_TO_INT_DEVICE_MAPPING.put(TYPE_BUILTIN_SPEAKER, AudioSystem.DEVICE_OUT_SPEAKER);
EXT_TO_INT_DEVICE_MAPPING.put(TYPE_WIRED_HEADSET, AudioSystem.DEVICE_OUT_WIRED_HEADSET)676         EXT_TO_INT_DEVICE_MAPPING.put(TYPE_WIRED_HEADSET, AudioSystem.DEVICE_OUT_WIRED_HEADSET);
EXT_TO_INT_DEVICE_MAPPING.put(TYPE_WIRED_HEADPHONES, AudioSystem.DEVICE_OUT_WIRED_HEADPHONE)677         EXT_TO_INT_DEVICE_MAPPING.put(TYPE_WIRED_HEADPHONES, AudioSystem.DEVICE_OUT_WIRED_HEADPHONE);
EXT_TO_INT_DEVICE_MAPPING.put(TYPE_LINE_ANALOG, AudioSystem.DEVICE_OUT_LINE)678         EXT_TO_INT_DEVICE_MAPPING.put(TYPE_LINE_ANALOG, AudioSystem.DEVICE_OUT_LINE);
EXT_TO_INT_DEVICE_MAPPING.put(TYPE_LINE_DIGITAL, AudioSystem.DEVICE_OUT_SPDIF)679         EXT_TO_INT_DEVICE_MAPPING.put(TYPE_LINE_DIGITAL, AudioSystem.DEVICE_OUT_SPDIF);
EXT_TO_INT_DEVICE_MAPPING.put(TYPE_BLUETOOTH_SCO, AudioSystem.DEVICE_OUT_BLUETOOTH_SCO)680         EXT_TO_INT_DEVICE_MAPPING.put(TYPE_BLUETOOTH_SCO, AudioSystem.DEVICE_OUT_BLUETOOTH_SCO);
EXT_TO_INT_DEVICE_MAPPING.put(TYPE_BLUETOOTH_A2DP, AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP)681         EXT_TO_INT_DEVICE_MAPPING.put(TYPE_BLUETOOTH_A2DP, AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP);
EXT_TO_INT_DEVICE_MAPPING.put(TYPE_HDMI, AudioSystem.DEVICE_OUT_HDMI)682         EXT_TO_INT_DEVICE_MAPPING.put(TYPE_HDMI, AudioSystem.DEVICE_OUT_HDMI);
EXT_TO_INT_DEVICE_MAPPING.put(TYPE_HDMI_ARC, AudioSystem.DEVICE_OUT_HDMI_ARC)683         EXT_TO_INT_DEVICE_MAPPING.put(TYPE_HDMI_ARC, AudioSystem.DEVICE_OUT_HDMI_ARC);
EXT_TO_INT_DEVICE_MAPPING.put(TYPE_HDMI_EARC, AudioSystem.DEVICE_OUT_HDMI_EARC)684         EXT_TO_INT_DEVICE_MAPPING.put(TYPE_HDMI_EARC, AudioSystem.DEVICE_OUT_HDMI_EARC);
EXT_TO_INT_DEVICE_MAPPING.put(TYPE_USB_DEVICE, AudioSystem.DEVICE_OUT_USB_DEVICE)685         EXT_TO_INT_DEVICE_MAPPING.put(TYPE_USB_DEVICE, AudioSystem.DEVICE_OUT_USB_DEVICE);
EXT_TO_INT_DEVICE_MAPPING.put(TYPE_USB_HEADSET, AudioSystem.DEVICE_OUT_USB_HEADSET)686         EXT_TO_INT_DEVICE_MAPPING.put(TYPE_USB_HEADSET, AudioSystem.DEVICE_OUT_USB_HEADSET);
EXT_TO_INT_DEVICE_MAPPING.put(TYPE_USB_ACCESSORY, AudioSystem.DEVICE_OUT_USB_ACCESSORY)687         EXT_TO_INT_DEVICE_MAPPING.put(TYPE_USB_ACCESSORY, AudioSystem.DEVICE_OUT_USB_ACCESSORY);
EXT_TO_INT_DEVICE_MAPPING.put(TYPE_DOCK, AudioSystem.DEVICE_OUT_DGTL_DOCK_HEADSET)688         EXT_TO_INT_DEVICE_MAPPING.put(TYPE_DOCK, AudioSystem.DEVICE_OUT_DGTL_DOCK_HEADSET);
EXT_TO_INT_DEVICE_MAPPING.put(TYPE_FM, AudioSystem.DEVICE_OUT_FM)689         EXT_TO_INT_DEVICE_MAPPING.put(TYPE_FM, AudioSystem.DEVICE_OUT_FM);
EXT_TO_INT_DEVICE_MAPPING.put(TYPE_TELEPHONY, AudioSystem.DEVICE_OUT_TELEPHONY_TX)690         EXT_TO_INT_DEVICE_MAPPING.put(TYPE_TELEPHONY, AudioSystem.DEVICE_OUT_TELEPHONY_TX);
EXT_TO_INT_DEVICE_MAPPING.put(TYPE_AUX_LINE, AudioSystem.DEVICE_OUT_AUX_LINE)691         EXT_TO_INT_DEVICE_MAPPING.put(TYPE_AUX_LINE, AudioSystem.DEVICE_OUT_AUX_LINE);
EXT_TO_INT_DEVICE_MAPPING.put(TYPE_IP, AudioSystem.DEVICE_OUT_IP)692         EXT_TO_INT_DEVICE_MAPPING.put(TYPE_IP, AudioSystem.DEVICE_OUT_IP);
EXT_TO_INT_DEVICE_MAPPING.put(TYPE_BUS, AudioSystem.DEVICE_OUT_BUS)693         EXT_TO_INT_DEVICE_MAPPING.put(TYPE_BUS, AudioSystem.DEVICE_OUT_BUS);
EXT_TO_INT_DEVICE_MAPPING.put(TYPE_HEARING_AID, AudioSystem.DEVICE_OUT_HEARING_AID)694         EXT_TO_INT_DEVICE_MAPPING.put(TYPE_HEARING_AID, AudioSystem.DEVICE_OUT_HEARING_AID);
EXT_TO_INT_DEVICE_MAPPING.put(TYPE_BUILTIN_SPEAKER_SAFE, AudioSystem.DEVICE_OUT_SPEAKER_SAFE)695         EXT_TO_INT_DEVICE_MAPPING.put(TYPE_BUILTIN_SPEAKER_SAFE,
696                 AudioSystem.DEVICE_OUT_SPEAKER_SAFE);
EXT_TO_INT_DEVICE_MAPPING.put(TYPE_REMOTE_SUBMIX, AudioSystem.DEVICE_OUT_REMOTE_SUBMIX)697         EXT_TO_INT_DEVICE_MAPPING.put(TYPE_REMOTE_SUBMIX, AudioSystem.DEVICE_OUT_REMOTE_SUBMIX);
EXT_TO_INT_DEVICE_MAPPING.put(TYPE_BLE_HEADSET, AudioSystem.DEVICE_OUT_BLE_HEADSET)698         EXT_TO_INT_DEVICE_MAPPING.put(TYPE_BLE_HEADSET, AudioSystem.DEVICE_OUT_BLE_HEADSET);
EXT_TO_INT_DEVICE_MAPPING.put(TYPE_BLE_SPEAKER, AudioSystem.DEVICE_OUT_BLE_SPEAKER)699         EXT_TO_INT_DEVICE_MAPPING.put(TYPE_BLE_SPEAKER, AudioSystem.DEVICE_OUT_BLE_SPEAKER);
EXT_TO_INT_DEVICE_MAPPING.put(TYPE_BLE_BROADCAST, AudioSystem.DEVICE_OUT_BLE_BROADCAST)700         EXT_TO_INT_DEVICE_MAPPING.put(TYPE_BLE_BROADCAST, AudioSystem.DEVICE_OUT_BLE_BROADCAST);
701 
702         // privileges mapping to input device
703         EXT_TO_INT_INPUT_DEVICE_MAPPING = new SparseIntArray();
EXT_TO_INT_INPUT_DEVICE_MAPPING.put(TYPE_BUILTIN_MIC, AudioSystem.DEVICE_IN_BUILTIN_MIC)704         EXT_TO_INT_INPUT_DEVICE_MAPPING.put(TYPE_BUILTIN_MIC, AudioSystem.DEVICE_IN_BUILTIN_MIC);
EXT_TO_INT_INPUT_DEVICE_MAPPING.put( TYPE_BLUETOOTH_SCO, AudioSystem.DEVICE_IN_BLUETOOTH_SCO_HEADSET)705         EXT_TO_INT_INPUT_DEVICE_MAPPING.put(
706                 TYPE_BLUETOOTH_SCO, AudioSystem.DEVICE_IN_BLUETOOTH_SCO_HEADSET);
EXT_TO_INT_INPUT_DEVICE_MAPPING.put( TYPE_WIRED_HEADSET, AudioSystem.DEVICE_IN_WIRED_HEADSET)707         EXT_TO_INT_INPUT_DEVICE_MAPPING.put(
708                 TYPE_WIRED_HEADSET, AudioSystem.DEVICE_IN_WIRED_HEADSET);
EXT_TO_INT_INPUT_DEVICE_MAPPING.put(TYPE_HDMI, AudioSystem.DEVICE_IN_HDMI)709         EXT_TO_INT_INPUT_DEVICE_MAPPING.put(TYPE_HDMI, AudioSystem.DEVICE_IN_HDMI);
EXT_TO_INT_INPUT_DEVICE_MAPPING.put(TYPE_TELEPHONY, AudioSystem.DEVICE_IN_TELEPHONY_RX)710         EXT_TO_INT_INPUT_DEVICE_MAPPING.put(TYPE_TELEPHONY, AudioSystem.DEVICE_IN_TELEPHONY_RX);
EXT_TO_INT_INPUT_DEVICE_MAPPING.put(TYPE_DOCK, AudioSystem.DEVICE_IN_DGTL_DOCK_HEADSET)711         EXT_TO_INT_INPUT_DEVICE_MAPPING.put(TYPE_DOCK, AudioSystem.DEVICE_IN_DGTL_DOCK_HEADSET);
EXT_TO_INT_INPUT_DEVICE_MAPPING.put( TYPE_USB_ACCESSORY, AudioSystem.DEVICE_IN_USB_ACCESSORY)712         EXT_TO_INT_INPUT_DEVICE_MAPPING.put(
713                 TYPE_USB_ACCESSORY, AudioSystem.DEVICE_IN_USB_ACCESSORY);
EXT_TO_INT_INPUT_DEVICE_MAPPING.put(TYPE_USB_DEVICE, AudioSystem.DEVICE_IN_USB_DEVICE)714         EXT_TO_INT_INPUT_DEVICE_MAPPING.put(TYPE_USB_DEVICE, AudioSystem.DEVICE_IN_USB_DEVICE);
EXT_TO_INT_INPUT_DEVICE_MAPPING.put(TYPE_USB_HEADSET, AudioSystem.DEVICE_IN_USB_HEADSET)715         EXT_TO_INT_INPUT_DEVICE_MAPPING.put(TYPE_USB_HEADSET, AudioSystem.DEVICE_IN_USB_HEADSET);
EXT_TO_INT_INPUT_DEVICE_MAPPING.put(TYPE_FM_TUNER, AudioSystem.DEVICE_IN_FM_TUNER)716         EXT_TO_INT_INPUT_DEVICE_MAPPING.put(TYPE_FM_TUNER, AudioSystem.DEVICE_IN_FM_TUNER);
EXT_TO_INT_INPUT_DEVICE_MAPPING.put(TYPE_TV_TUNER, AudioSystem.DEVICE_IN_TV_TUNER)717         EXT_TO_INT_INPUT_DEVICE_MAPPING.put(TYPE_TV_TUNER, AudioSystem.DEVICE_IN_TV_TUNER);
EXT_TO_INT_INPUT_DEVICE_MAPPING.put(TYPE_LINE_ANALOG, AudioSystem.DEVICE_IN_LINE)718         EXT_TO_INT_INPUT_DEVICE_MAPPING.put(TYPE_LINE_ANALOG, AudioSystem.DEVICE_IN_LINE);
EXT_TO_INT_INPUT_DEVICE_MAPPING.put(TYPE_LINE_DIGITAL, AudioSystem.DEVICE_IN_SPDIF)719         EXT_TO_INT_INPUT_DEVICE_MAPPING.put(TYPE_LINE_DIGITAL, AudioSystem.DEVICE_IN_SPDIF);
EXT_TO_INT_INPUT_DEVICE_MAPPING.put( TYPE_BLUETOOTH_A2DP, AudioSystem.DEVICE_IN_BLUETOOTH_A2DP)720         EXT_TO_INT_INPUT_DEVICE_MAPPING.put(
721                 TYPE_BLUETOOTH_A2DP, AudioSystem.DEVICE_IN_BLUETOOTH_A2DP);
EXT_TO_INT_INPUT_DEVICE_MAPPING.put(TYPE_IP, AudioSystem.DEVICE_IN_IP)722         EXT_TO_INT_INPUT_DEVICE_MAPPING.put(TYPE_IP, AudioSystem.DEVICE_IN_IP);
EXT_TO_INT_INPUT_DEVICE_MAPPING.put(TYPE_BUS, AudioSystem.DEVICE_IN_BUS)723         EXT_TO_INT_INPUT_DEVICE_MAPPING.put(TYPE_BUS, AudioSystem.DEVICE_IN_BUS);
EXT_TO_INT_INPUT_DEVICE_MAPPING.put( TYPE_REMOTE_SUBMIX, AudioSystem.DEVICE_IN_REMOTE_SUBMIX)724         EXT_TO_INT_INPUT_DEVICE_MAPPING.put(
725                 TYPE_REMOTE_SUBMIX, AudioSystem.DEVICE_IN_REMOTE_SUBMIX);
EXT_TO_INT_INPUT_DEVICE_MAPPING.put(TYPE_BLE_HEADSET, AudioSystem.DEVICE_IN_BLE_HEADSET)726         EXT_TO_INT_INPUT_DEVICE_MAPPING.put(TYPE_BLE_HEADSET, AudioSystem.DEVICE_IN_BLE_HEADSET);
EXT_TO_INT_INPUT_DEVICE_MAPPING.put(TYPE_HDMI_ARC, AudioSystem.DEVICE_IN_HDMI_ARC)727         EXT_TO_INT_INPUT_DEVICE_MAPPING.put(TYPE_HDMI_ARC, AudioSystem.DEVICE_IN_HDMI_ARC);
EXT_TO_INT_INPUT_DEVICE_MAPPING.put(TYPE_HDMI_EARC, AudioSystem.DEVICE_IN_HDMI_EARC)728         EXT_TO_INT_INPUT_DEVICE_MAPPING.put(TYPE_HDMI_EARC, AudioSystem.DEVICE_IN_HDMI_EARC);
EXT_TO_INT_INPUT_DEVICE_MAPPING.put( TYPE_ECHO_REFERENCE, AudioSystem.DEVICE_IN_ECHO_REFERENCE)729         EXT_TO_INT_INPUT_DEVICE_MAPPING.put(
730                 TYPE_ECHO_REFERENCE, AudioSystem.DEVICE_IN_ECHO_REFERENCE);
731 
732     }
733 }
734 
735