Since Android 10, apps can request three levels of location permission: Allow all the time, Allow only while using the app, and Deny. The first option lets an app collect your GPS data even when it isn’t visible on the screen. This capability powers useful features—like fitness tracking or weather widgets—but it also creates a privacy risk if the permission is granted unintentionally.
Restricting background location reduces the amount of personal data that can be harvested, helps preserve battery life, and complies with many data‑protection regulations. The steps below work on Android 10, 11, 12 and newer, with optional ADB commands for devices that do not expose a UI toggle.
Android provides a built‑in view that lists apps with background location access. Follow these steps:
If the UI differs slightly—e.g., on Samsung One UI or Xiaomi MIUI—the path is still Settings → Privacy → Location → Permission manager. The goal is to see which apps have the most permissive setting.
For each app you want to limit, do the following:
Repeat for every entry in the “Allow all the time” list. After you finish, you should see only a few or none remaining.
Android 11 introduced a one‑time permission option for location. If you prefer a temporary grant:
This is handy for occasional utilities like a QR‑code scanner that needs location just once.
Some pre‑installed system apps—especially on devices with custom skins—may not expose a UI toggle for background location. In those cases you can use the Android Debug Bridge (ADB) to modify the permission directly.
Prerequisites:
Once the setup is complete, connect the phone via USB and run the following commands in a terminal:
# List all packages that currently have the "allow all the time" location permission
adb shell pm list packages -3 | while read -r pkg; do
perms=$(adb shell dumpsys package $pkg | grep "android.permission.ACCESS_BACKGROUND_LOCATION" -A1);
if echo "$perms" | grep -q "granted=true"; then
echo "$pkg";
fi;
done
This script prints the package names of third‑party apps with background location granted. For each package you want to modify, run:
# Revoke the background location permission
adb shell pm revoke <PACKAGE_NAME> android.permission.ACCESS_BACKGROUND_LOCATION
Replace <PACKAGE_NAME> with the actual identifier, e.g., com.example.weather. To grant a less permissive level instead of revoking entirely, you can use:
# Grant only "while‑in‑use" permission (Android 11+)
adb shell pm grant <PACKAGE_NAME> android.permission.ACCESS_FINE_LOCATION
Note that the pm grant command only works for runtime permissions on apps that target API 23+ and are not system‑privileged.
After adjusting permissions, it’s a good idea to confirm that the changes took effect.
adb shell pm dump <PACKAGE_NAME> | grep ACCESS_BACKGROUND_LOCATION. The output should show granted=false.Restricting background location is generally safe, but be aware of the following:
New apps installed after you’ve completed the steps will request location permissions anew. To keep your privacy posture consistent:
Restricting background location on Android is a straightforward process that combines built‑in UI controls with optional ADB commands for deeper control. By regularly auditing which apps have the “Allow all the time” permission and downgrading them to “While using the app” or revoking the permission entirely, you protect your privacy, extend battery life, and stay compliant with modern data‑protection expectations. The steps outlined above work across most Android 10+ devices, and the ADB method ensures you can handle stubborn system apps that hide the toggle.









