I'm a bit confused about the background limitations of apps, and I could use an explanation. So, starting from Android 8 we have limitations on services and sending broadcasts. As for now, we can only make the service run in the background if it has the foreground notification, otherwise, it will be killed. The app is considered to be in the background if none of its activities are visible, and my questions are: 1. For how long can the app process itself live without foreground service? For instance, if I go to the home screen, thereby putting the app in the background my app can still play sounds for hours, but I expected it will be killed by the system in a couple of minutes. 2. Is foreground service somehow related to the application lifecycle? For instance, maybe if I start the foreground service then my app won't get killed or less likely to be killed by the system.
I'm asking all this because my app is using C++ libs to make VOIP calls and do other stuff in the background and I'm wondering what would happen if I just open the home screen and leave my app working, so far I've never seen the system kill the app while the call is active.