Skip to content
Snippets Groups Projects
Commit 19cc5b8b authored by Vincent Lucas's avatar Vincent Lucas
Browse files

Creates a property named...

Creates a property named org.jitsi.impl.neomadia.device.disableUsbDeviceAutoSelection in order to disable the automatic selection of USB audio devices (if set to true).
parent 423f51e7
No related branches found
No related tags found
No related merge requests found
......@@ -20,6 +20,14 @@
*/
public abstract class Devices
{
/**
* The name of the <tt>ConfigurationService</tt> <tt>boolean</tt> property
* which indicates whether the automatic selection of USB devices must be
* disabled. The default value is <tt>false</tt>.
*/
private static final String PROP_DISABLE_USB_DEVICE_AUTO_SELECTION
= "org.jitsi.impl.neomadia.device.disableUsbDeviceAutoSelection";
/**
* The audio system managing this device list.
*/
......@@ -75,6 +83,21 @@ public ExtendedCaptureDeviceInfo getDevice(
if(!devicePreferences.contains(
activeDevice.getModelIdentifier()))
{
// By default, select automatically the USB devices.
boolean isSelected
= activeDevice.isSameTransportType("USB");
ConfigurationService cfg
= LibJitsi.getConfigurationService();
// Desactivate the USB device automatic selection if the
// property is set to true.
if(cfg != null
&& cfg.getBoolean(
PROP_DISABLE_USB_DEVICE_AUTO_SELECTION,
false))
{
isSelected = false;
}
// Adds the device in the preference list (to the end of the
// list, but the save device will push it to the top of
// active devices).
......@@ -83,7 +106,7 @@ public ExtendedCaptureDeviceInfo getDevice(
property,
activeDevice,
activeDevices,
activeDevice.isSameTransportType("USB"));
isSelected);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment