I love this from the documentation about limiting background location services:
Important: As a starting point, we're allowing background apps to receive location updates only a few times each hour. We're continuing to tune the location update interval throughout the Preview based on system impact and feedback from developers.
Holy shit, that's huge and should hopefully go a long day to reign in background apps constantly checking for location.
In order to preserve battery, user experience, and system health, background apps receive location updates less frequently when used on a device running Android O. This behavior change affects all apps that receive location updates, including Google Play services.
I would like to see a separate permission for 'continuous' location information vs. 'occasional' location. That way apps like Maps that need it can have it, but you can rein in the rest.
I would be surprised if there isn't a caching mechanism in place for location information. If apps A,B,C,D want to get location information it makes 0 sense to ping the GPS 4 times for the same thing.
Note: If your app needs access to location history that contains time-frequent updates, use the batched version of the Fused Location Provider API elements, such as the FusedLocationProviderApi interface. When your app is running in the background, this API receives the user's location more frequently than the non-batched API. Keep in mind, however, that your app still receives updates in batches only a few times each hour.
So it sounds like the OS is still keeping track of your location, it's just not letting background apps trigger a refresh on-demand, and it'll only wake up those apps every so often to process that information in batches instead of waking them up every time your location updates.
Makes me kinda depressed cause it shows me travelling this huge distance only to scribble around in one spot and then turn back. My commute could lead to so many adventures if only I had time to take the side streets.
I wonder what this means for GeoFencing type applications. Childs Location/Home Automation/Exercise. There are certain applications that require a high polling rate and accuracy to function well.
There's more to it than that. For instance, at my company, all our field techs have tracking software on their tablets that automatically start at the beginning of their shift and stop at their end.
When they are in route (or basically any time they aren't actively working a job) to a clients location it pings their device pretty frequently for location updates to create a breadcrumb trail of their route, and also allows us to find the closest tech who's not currently on a job if an emergency ticket comes through. Battery life isn't a concern since they have a charging dock in their trucks.
This is a niche use case, I understand, but I have to assume LOTS of business run similar stuff.
That said, I doubt their tablets are going to get O anytime soon (probably not at all) so it's probably a non-issue for us.
For that you just need to run a foreground service (which displays a persistent notification).
That way your app can do its thing, but user is aware that it's running. So it can't just silently drain battery life in the background without the user being aware of it or having any recourse to stop it from running.
This is the only thing I want from Android O. To make notifications less ugly and to be able to hide ongoing notifications without getting rid of all notifications from that app. It surprised me this hasn't been taken care of yet. Even the old TouchWiz would seperate ongoing notifications from real ones but they stopped doing that for some reason.
3.5k
u/slinky317 HTC Incredible Mar 21 '17
I love this from the documentation about limiting background location services:
Holy shit, that's huge and should hopefully go a long day to reign in background apps constantly checking for location.
I wonder if that applies to Google Play Services?