Loading media/java/android/media/AudioManager.java +4 −2 Original line number Diff line number Diff line Loading @@ -7670,8 +7670,10 @@ public class AudioManager { * or video calls. This method can be used by voice or video chat applications to select a * different audio device than the one selected by default by the platform. * <p>The device selection is expressed as an {@link AudioDeviceInfo} among devices returned by * {@link #getAvailableCommunicationDevices()}. * The selection is active as long as the requesting application process lives, until * {@link #getAvailableCommunicationDevices()}. Note that only devices in a sink role * (AKA output devices, see {@link AudioDeviceInfo#isSink()}) can be specified. The matching * source device is selected automatically by the platform. * <p>The selection is active as long as the requesting application process lives, until * {@link #clearCommunicationDevice} is called or until the device is disconnected. * It is therefore important for applications to clear the request when a call ends or the * the requesting activity or service is stopped or destroyed. Loading services/core/java/com/android/server/audio/AudioService.java +8 −1 Original line number Diff line number Diff line Loading @@ -5863,6 +5863,9 @@ public class AudioService extends IAudioService.Stub }; private boolean isValidCommunicationDevice(AudioDeviceInfo device) { if (!device.isSink()) { return false; } for (int type : VALID_COMMUNICATION_DEVICE_TYPES) { if (device.getType() == type) { return true; Loading Loading @@ -5897,7 +5900,11 @@ public class AudioService extends IAudioService.Stub throw new IllegalArgumentException("invalid portID " + portId); } if (!isValidCommunicationDevice(device)) { throw new IllegalArgumentException("invalid device type " + device.getType()); if (!device.isSink()) { throw new IllegalArgumentException("device must have sink role"); } else { throw new IllegalArgumentException("invalid device type: " + device.getType()); } } } final String eventSource = new StringBuilder() Loading Loading
media/java/android/media/AudioManager.java +4 −2 Original line number Diff line number Diff line Loading @@ -7670,8 +7670,10 @@ public class AudioManager { * or video calls. This method can be used by voice or video chat applications to select a * different audio device than the one selected by default by the platform. * <p>The device selection is expressed as an {@link AudioDeviceInfo} among devices returned by * {@link #getAvailableCommunicationDevices()}. * The selection is active as long as the requesting application process lives, until * {@link #getAvailableCommunicationDevices()}. Note that only devices in a sink role * (AKA output devices, see {@link AudioDeviceInfo#isSink()}) can be specified. The matching * source device is selected automatically by the platform. * <p>The selection is active as long as the requesting application process lives, until * {@link #clearCommunicationDevice} is called or until the device is disconnected. * It is therefore important for applications to clear the request when a call ends or the * the requesting activity or service is stopped or destroyed. Loading
services/core/java/com/android/server/audio/AudioService.java +8 −1 Original line number Diff line number Diff line Loading @@ -5863,6 +5863,9 @@ public class AudioService extends IAudioService.Stub }; private boolean isValidCommunicationDevice(AudioDeviceInfo device) { if (!device.isSink()) { return false; } for (int type : VALID_COMMUNICATION_DEVICE_TYPES) { if (device.getType() == type) { return true; Loading Loading @@ -5897,7 +5900,11 @@ public class AudioService extends IAudioService.Stub throw new IllegalArgumentException("invalid portID " + portId); } if (!isValidCommunicationDevice(device)) { throw new IllegalArgumentException("invalid device type " + device.getType()); if (!device.isSink()) { throw new IllegalArgumentException("device must have sink role"); } else { throw new IllegalArgumentException("invalid device type: " + device.getType()); } } } final String eventSource = new StringBuilder() Loading