Quote:
Originally Posted by kovidgoyal
Doesn't the wireless driver listen for connections in a separate thread? In which case why would re-ordering the scan list make any difference?
|
Yes, the wireless driver does accept connections on a separate thread. It then waits up to 6 seconds for the device subsystem to come along and really "open" the connection.
The order that devices are processed in device.DeviceManager.do_connect appears to be the order of the plugins in customize.ui.py. If I am reading this correctly, if a device that is "misbehaving" in terms of eject status (or some other reason) appears before some other device in the possibly_connected list then the misbehaving device will always be processed first. My thought is that if the wireless driver were higher in the list then it would be polled before the misbehaving device.
This change is safe because there isn't any ambiguity about whether the wireless driver is connected or ejected. Ejecting closes the socket. There is no cable that must be removed.
The other option might be to redo the wireless driver with MANAGES_DEVICE_PRESENCE == True. That would move it into the other loop along with the MTP driver. I don't know what a change like this would entail.