I have a foreground service that needs to get a single location update.It is started by a specific broadcast, and upon starting it simply does a request on our backend. When it receives another broadcast, it requests a location update (once), does another backend request and then stops itself.Edit: to clarify, the service itself does the location updates and backend requests. It is independent from the main app in that regard.This works well on Lollipop and Marshmallow, both when the phone is awake or in Doze mode. But for some reason, on Android O the service never gets location updates when in Doze mode. Networking works fine as its first request goes through in both situations. Also, if I wake up the phone while the location request it running, it will get the update. Same if I put it in maintenance window.Android O does introduce some limitations on background location but as the page mentions, the foreground app behavior (app visible or foreground service running) should be preserved and be similar to previous versions of Android.Is this an issue in the developer preview or a restriction that I missed? 解决方案 Take a look on LocationUpdatesForegroundService Sample: Code Samples for Android O, maybe you do something wrong.Get it on GitHub: Java 这篇关于前景服务未在Android O中以打ze模式接收位置更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!