Stopping or clearing Ceno should be accompained by an animation or pop-up
After updating to ouinet v0.21.8 and implementing the OuinetBackground feature, I've noticed a UI bug when stopping or clearing Ceno. To reproduce,
- Stop or clear+stop Ceno (with either the notification or toolbar button)
- Within 5s, try to reopen Ceno.
- It will reopen to where the application was before, but will be frozen and then in a few seconds it will close by itself.
This is caused by a change in how the Ouinet client is started with OuinetBackground. Previously, ouinet was started inside of the foreground service thread. This meant that when Ouinet was stopped, it would only block the foreground notification's UI. However, this was bad form, because we were killing the main application process before the service process stopped (because ouinet takes a good 5s to stop). With the update to OuinetBackground, we are now stopping Ouinet in the main process thread (well, technically we are stopping ouinet in a separate thread, but then immediately joining that thread from the main thread).
Ideally, we should wait for Ouinet to stop before killing the app, but since ouinet takes a not insignificant amount of time to stop, we need some sort of placeholder pop-up or animation.