In my code sample, location updates are not sent on an Android O device when it goes into idle (doze) mode. Has anyone gotten this to work? There are no issues on any devices prior to Android O (before API 26 added the location update throttling)
The code in question is here: https://github.com/jcraw/api_26_location_updates_idle
The MainActivity binds to a foreground service which puts the location updates into logcat.
The code was tested as follows:
- Create virtual device (Pixel API 26)
- In the 'extended controls' for the virtual device, load and then start a GPX file
- Use power button on virtual device to disable screen
- adb shell dumpsys battery unplug
- adb shell dumpsys deviceidle step
- repeat step 5 until device is in IDLE state