0

Is there a way to choose what apps are allowed or denied to run background services in Android 9? I know that I can kill them in Settings > Apps & notifications > 〈 app 〉 > Force stop, but I need that

  1. the service is never started until I open the app;
  2. it is run when I open the app;
  3. it is killed when I close the app.

Let me make an example with WhatsApp (which is not an app I'm having problems with but makes it easier to explain what I need):

  • when I boot the phone it shouldn't check for new messages
  • when I open WhatsApp it should download them
  • once I closed the app new messages shouldn't check for new messages until I open it again

If possible I would prefer a non-root solution.


Update

That's not a duplicate of Disable autostart on boot: I need not only to prevent autostart at boot, but also to kill all the background processes of the app when I close it.

Ntakwetet
  • 123
  • 6
  • 2
  • What you want is an app specific configuration - configure this inside of WhatsApp. Android is just the OS. If WhatsApp does not allow to do so may be you should think about using a messenger that better suits you needs. – Robert Feb 29 '20 at 15:45
  • @Robert My problem is not about WhatsApp but with some other apps - I just chose the best known app to explain the question better. – Ntakwetet Feb 29 '20 at 17:55
  • @IrfanLatif It is quite useful but it doesn't answer all my question. I don't only need to prevent the app to run a background service at boot but also to kill all of its processes when I close it. – Ntakwetet Feb 29 '20 at 18:00
  • @Ntakwetet denying RUN_IN_BACKGROUND and/or RUN_ANY_IN_BACKGROUND prevents the app to run a background service when you close it (i.e. when the app is not in foreground). If by "kill all of its processes" you mean the native processs (Virtual Machines), that's only possible using Force Stop. But that's unnecessary because cached process cannot do any background activity if restricted in Java framework. "Don't keep activities" and "Background process limit" in Developer Options are more aggressive ways to kill background app processes but they apply to all apps and never recommended. – Irfan Latif Feb 29 '20 at 18:07

0 Answers0