logo

How to stop background apps on Android?


Must read:

Why you need to stop background apps?

It's important for two major reasons:

Restrict Background Execution

For most of the categories described in Why do apps run in background on Android?, apps won't run in background if the following AppOp permissions are not granted:

Up to Android 11 the first one is labeled as Battery Optimization in device Settings. While the later is labeled as Background Restriction:

Android background permissions

Since Android 12 both of the above AppOp permission are denied when "Restricted" option is selected:

Android background permissions

There are two additional permissions which may help:

Also:

You can use appops commandline tool to set these permissions. PermissionManagerX provides a convenient and elegant way to do the same:

Exceptions:

Disable apps

If you find a system app purposelessly running in background, and you cannot uninstall it either, disabling the app is also an option. Use pm disable command or PermissionManagerX:

But note that Android operating system can enable an app if it is required by some other app. This is very common with apps from Google Mobile Suite (Play Services and company).

Disable components (root only)

Activities (the visible parts of an app), Services, Content Providers, and Broadcast Receivers are app components which can be disabled or blocked on rooted devices. This is useful when you don't want to completely disable or uninstall the app but still want to lock down its malicious or anti-privacy activities.

This can be done in two ways:

Both of these methods will be soon available in our upcoming app Ajza.

Note that this approach is dangerous particularly when applied to system and framework apps. You disable a component from some critical app, and the device gets into bootloop. So be cautious!

Cached apps

Generally you should not be worried about cached apps because they are in a dormant state. But starting with Android 11 there is an option in Developer Options named: “Suspend execution for cached apps” (introduced here). It uses “Freezer Control Group” to completely stop an app's activity when it's in cached state. You can enable this feature for additional protection.


Android Official documentation:

Background Execution LimitsBackground processingBackground optimizations

Power Management RestrictionsTest power-related issues


Related:

Comments