Since the device object (local to DCS) is set to null on disconnect, the
notification could not get updated from within the receiver. DeviceManager
does not have such issues.
The problem appeared with 3f421facab
What happens in reality is that devices are sorted according to their
connection status first, and then by name. So even if/when we support
multiple device connection, the order should remain sane.
This closes#842.
Fixed a race condition between ACTION_DEVICE_CHANGED event handlers:
- DeviceCommunicationService added the device to the database
- DeviceManager notified the views to be refreshed
When the latter happened before the former, thew new device would not
be displayed.
=> Let DeviceManager do both.
Basically moved code out of ControlCenter to a separate class. Also provides
change events when the device list has changed, or changes to the device
state have occurred.