Loading media/java/android/media/AudioDeviceAttributes.java +1 −1 Original line number Diff line number Diff line Loading @@ -110,7 +110,7 @@ public final class AudioDeviceAttributes implements Parcelable { mNativeType = AudioDeviceInfo.convertDeviceTypeToInternalDevice(type); } else if (role == ROLE_INPUT) { AudioDeviceInfo.enforceValidAudioDeviceTypeIn(type); mNativeType = AudioDeviceInfo.convertDeviceTypeToInternalInputDevice(type); mNativeType = AudioDeviceInfo.convertDeviceTypeToInternalInputDevice(type, address); } else { mNativeType = AudioSystem.DEVICE_NONE; } Loading media/java/android/media/AudioDeviceInfo.java +10 −4 Original line number Diff line number Diff line Loading @@ -581,7 +581,16 @@ public final class AudioDeviceInfo { /** @hide */ public static int convertDeviceTypeToInternalInputDevice(int deviceType) { return EXT_TO_INT_INPUT_DEVICE_MAPPING.get(deviceType, AudioSystem.DEVICE_NONE); return convertDeviceTypeToInternalInputDevice(deviceType, ""); } /** @hide */ public static int convertDeviceTypeToInternalInputDevice(int deviceType, String address) { int internalType = EXT_TO_INT_INPUT_DEVICE_MAPPING.get(deviceType, AudioSystem.DEVICE_NONE); if (internalType == AudioSystem.DEVICE_IN_BUILTIN_MIC && "back".equals(address)) { internalType = AudioSystem.DEVICE_IN_BACK_MIC; } return internalType; } private static final SparseIntArray INT_TO_EXT_DEVICE_MAPPING; Loading Loading @@ -671,9 +680,6 @@ public final class AudioDeviceInfo { 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_ANLG_DOCK_HEADSET); EXT_TO_INT_DEVICE_MAPPING.put(TYPE_FM, AudioSystem.DEVICE_OUT_FM); EXT_TO_INT_DEVICE_MAPPING.put(TYPE_BUILTIN_MIC, AudioSystem.DEVICE_IN_BUILTIN_MIC); EXT_TO_INT_DEVICE_MAPPING.put(TYPE_FM_TUNER, AudioSystem.DEVICE_IN_FM_TUNER); EXT_TO_INT_DEVICE_MAPPING.put(TYPE_TV_TUNER, AudioSystem.DEVICE_IN_TV_TUNER); 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); EXT_TO_INT_DEVICE_MAPPING.put(TYPE_IP, AudioSystem.DEVICE_OUT_IP); Loading media/java/android/media/AudioSystem.java +1 −1 Original line number Diff line number Diff line Loading @@ -1915,7 +1915,7 @@ public class AudioSystem types[i] = devices.get(i).getInternalType(); if (types[i] == AudioSystem.DEVICE_NONE) { types[i] = AudioDeviceInfo.convertDeviceTypeToInternalInputDevice( devices.get(i).getType()); devices.get(i).getType(), devices.get(i).getAddress()); } addresses[i] = devices.get(i).getAddress(); } Loading media/java/android/media/audiofx/AudioEffect.java +6 −1 Original line number Diff line number Diff line Loading @@ -511,7 +511,12 @@ public class AudioEffect { int deviceType = AudioSystem.DEVICE_NONE; String deviceAddress = ""; if (device != null) { if (device.getRole() == AudioDeviceAttributes.ROLE_OUTPUT) { deviceType = AudioDeviceInfo.convertDeviceTypeToInternalDevice(device.getType()); } else { deviceType = AudioDeviceInfo.convertDeviceTypeToInternalInputDevice( device.getType(), device.getAddress()); } deviceAddress = device.getAddress(); } Loading Loading
media/java/android/media/AudioDeviceAttributes.java +1 −1 Original line number Diff line number Diff line Loading @@ -110,7 +110,7 @@ public final class AudioDeviceAttributes implements Parcelable { mNativeType = AudioDeviceInfo.convertDeviceTypeToInternalDevice(type); } else if (role == ROLE_INPUT) { AudioDeviceInfo.enforceValidAudioDeviceTypeIn(type); mNativeType = AudioDeviceInfo.convertDeviceTypeToInternalInputDevice(type); mNativeType = AudioDeviceInfo.convertDeviceTypeToInternalInputDevice(type, address); } else { mNativeType = AudioSystem.DEVICE_NONE; } Loading
media/java/android/media/AudioDeviceInfo.java +10 −4 Original line number Diff line number Diff line Loading @@ -581,7 +581,16 @@ public final class AudioDeviceInfo { /** @hide */ public static int convertDeviceTypeToInternalInputDevice(int deviceType) { return EXT_TO_INT_INPUT_DEVICE_MAPPING.get(deviceType, AudioSystem.DEVICE_NONE); return convertDeviceTypeToInternalInputDevice(deviceType, ""); } /** @hide */ public static int convertDeviceTypeToInternalInputDevice(int deviceType, String address) { int internalType = EXT_TO_INT_INPUT_DEVICE_MAPPING.get(deviceType, AudioSystem.DEVICE_NONE); if (internalType == AudioSystem.DEVICE_IN_BUILTIN_MIC && "back".equals(address)) { internalType = AudioSystem.DEVICE_IN_BACK_MIC; } return internalType; } private static final SparseIntArray INT_TO_EXT_DEVICE_MAPPING; Loading Loading @@ -671,9 +680,6 @@ public final class AudioDeviceInfo { 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_ANLG_DOCK_HEADSET); EXT_TO_INT_DEVICE_MAPPING.put(TYPE_FM, AudioSystem.DEVICE_OUT_FM); EXT_TO_INT_DEVICE_MAPPING.put(TYPE_BUILTIN_MIC, AudioSystem.DEVICE_IN_BUILTIN_MIC); EXT_TO_INT_DEVICE_MAPPING.put(TYPE_FM_TUNER, AudioSystem.DEVICE_IN_FM_TUNER); EXT_TO_INT_DEVICE_MAPPING.put(TYPE_TV_TUNER, AudioSystem.DEVICE_IN_TV_TUNER); 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); EXT_TO_INT_DEVICE_MAPPING.put(TYPE_IP, AudioSystem.DEVICE_OUT_IP); Loading
media/java/android/media/AudioSystem.java +1 −1 Original line number Diff line number Diff line Loading @@ -1915,7 +1915,7 @@ public class AudioSystem types[i] = devices.get(i).getInternalType(); if (types[i] == AudioSystem.DEVICE_NONE) { types[i] = AudioDeviceInfo.convertDeviceTypeToInternalInputDevice( devices.get(i).getType()); devices.get(i).getType(), devices.get(i).getAddress()); } addresses[i] = devices.get(i).getAddress(); } Loading
media/java/android/media/audiofx/AudioEffect.java +6 −1 Original line number Diff line number Diff line Loading @@ -511,7 +511,12 @@ public class AudioEffect { int deviceType = AudioSystem.DEVICE_NONE; String deviceAddress = ""; if (device != null) { if (device.getRole() == AudioDeviceAttributes.ROLE_OUTPUT) { deviceType = AudioDeviceInfo.convertDeviceTypeToInternalDevice(device.getType()); } else { deviceType = AudioDeviceInfo.convertDeviceTypeToInternalInputDevice( device.getType(), device.getAddress()); } deviceAddress = device.getAddress(); } Loading