To set an app's "Allow background usage" permission on LineageOS using ADB, you can use the following command:
bashadb shell cmd appops set <package_name> RUN_IN_BACKGROUND allow
Replace <package_name> with the actual package name of the app you want to allow background usage for. For example, if you want to allow background usage for WhatsApp, you would use:
bashadb shell cmd appops set com.whatsapp RUN_IN_BACKGROUND allow
This command will enable the app to run in the background, which corresponds to the "Allow background usage" setting in the UI.
If you want to restrict background usage instead, use:
bashadb shell cmd appops set <package_name> RUN_IN_BACKGROUND ignore
This is the standard ADB method for controlling background app restrictions on Android, including LineageOS.
This Chat is read-only. Login to resume chatting.