There's indeed an undocumented shell command, which can be used to white-list packages, by adding them to the global location_background_throttle_package_whitelist
(I haven't tested it):
settings put global location_background_throttle_package_whitelist "package1,package2,package3"
^ this is for location
services, but there might be further background_throttle
settings available:
settings list global | grep background_throttle
Source: XDA Developers.
Also in the source code I've only found these settings:
Settings.Global.LOCATION_BACKGROUND_THROTTLE_PACKAGE_WHITELIST
Settings.Global.LOCATION_BACKGROUND_THROTTLE_PROXIMITY_ALERT_INTERVAL_MS
Settings.Global.LOCATION_BACKGROUND_THROTTLE_INTERVAL_MS
The documentation is clear about the fact that certain services are being added into a temporary white-list. To find out what actually white-lists these services, one would have to dig further. These background service restriction is actually being described in Context.java ...while the methods annotated with @UnsupportedAppUsage
are the ones which only the system uses.
The Firebase WorkManager is still the best option available - or the underlying JobIntentService, which will still run as a regular background service < Android O
. Flashing Android N
or Lineage OS 14.1
would be a certain workaround, which is barely being considered.
The assumption that root
permissions would provide super-powers might be a misconception. Permitting unfettered location access is still quite limited and even Google's own services are only temporarily white-listed. The only services excluded from these background execution restrictions would be Linux system services, written in C++
(which are running outside of the JVM) - while this is something very else than Android background services, written in Java
(which are running inside the JVM and all extend the same restricted Service
class).