Workaround for IllegalStateException on Pie
Android 9 has a bug, sometimes, service cannot be started as soon as app is: https://issuetracker.google.com/issues/113122354
This fix creates a suspend function which will wait for the app to go foreground, and use it to launch the service only when we can