USB device disconnect is sporadically not registered correctly
What steps will reproduce the issue?
- Plug in a USB tuner device
- Let it pick up some messages
- Unplug the device
- Observe the notification
- After some time, plug the device back in again
- Observe behavior
What behavior did you expect?
Upon unplugging the device, the notification disappears. When I plug it in again, the notification returns and the device starts scanning the FM band and picking up new messages.
What behavior are you seeing instead?
Sporadically the notification stays after unplugging the device. When I plug the device back in, the signal strength indicator “flashes” between two states and no messages are received. The logcat show that it is flipping back and forth between two frequencies, which appear to be the start of the band and the last frequency received before the device was first unplugged.
It appears that the old thread which controls and reads from the device never gets killed, and when the device is plugged back in, there are now two competing threads which alternate in sending commands to the device.
What version of the software are you using? On what operating system (distribution and version)? Please also indicate related software which may be of importance here.
Several dev versions post-1.2, on LineageOS 14.1