-
Notifications
You must be signed in to change notification settings - Fork 22
Description
Issue:
If the app, for any reason, goes to the background long enough for Android to kill the process, then it will lose connection to the DCC controller (DCC-EX for example). It will then fail to reconnect when the app is re-focused, requiring a full app restart (without this being clearly obvious). This isn't great - and also any captured engines will still be running and not easily stoppable.
Potential Solutions:
While not familiar with the current codebase, Android's ProcessLifecycleOwner broadcasts events when the app is going to be sent to the background and when brought back to the foreground. These events could be usable to improve most of these issues (without needing the effort of making the app background runnable with services etc):
- When the app is delegated to the background, currently captured trains could be auto-stopped (this could be a setting maybe?)
- When the app is returned to the foreground, it could properly handle it - e.g. cleaning up the old terminated connection and throwing you back to the connection selection screen - so that a full app restart is not required.
Reasoning:
Due to its great array of features, Engine Driver is a popular choice for DIY DCC layouts. These layouts are not always used solely by people experienced with the software and setup. Inevitably, even if instructed otherwise, people will (and do) switch to look at a message, search something online, etc. And even for those more experienced with it - phone calls, urgent messages, etc happen. A lot of people in this hobby space may also be less familiar/comfortable with technology in general, so this significant added friction is not great.
I believe this would be a quality of life feature that would greatly reduce annoyances, issues, and runaway trains, while simultaneously not requiring e.g. a huge rewrite of all the networking logic to use background services etc.