To set an app's "Allow background usage" permission on LineageOS using ADB, you can use the following command:
adb shell cmd appops set <package_name> RUN_IN_BACKGROUND allowReplace <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:
adb shell cmd appops set com.whatsapp RUN_IN_BACKGROUND allowThis 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:
adb shell cmd appops set <package_name> RUN_IN_BACKGROUND ignoreThis is the standard ADB method for controlling background app restrictions on Android, including LineageOS.
Vibe can make mistakes. Check answers. Learn more