I have an app that wants to run a foreground service (not configurable) but I want the regular Android power restrictions to be applied to it because the foreground service is unnecessary (I always start it manually when needed).

I do not want to force-stop the app.

How can I prevent the app from starting a background service? I tried pm revoke <packagename> android.permission.FOREGROUND_SERVICE but apparently that's not a changeable permission type.

1 Answer 1


This permission is always granted but is managed via AppOps.

To prevent an app from using it, run appops set <packagename> START_FOREGROUND ignore.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .