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