Search code examples
androidgoogle-play-servicesgeofencingwakeup

Excessive WakeUps warned by Android Vitals for Google Play Services geofences


I am currently working in a sample app for Android which uses geofencing for location monitoring, and I am finding it difficult to comply with Android Vitals background wakeup limit (https://developer.android.com/topic/performance/vitals/wakeup.html).

I am using Battery Historian to monitor wakeups, and while our own alarms stand at a less than one per hour rate, both com.google.android.location.ALARM_WAKEUP_ACTIVITY_DETECTION and com.google.android.location.ALARM_WAKEUP_LOCATOR trigger at much bigger rates. I experimented setting the geofences responsiveness delay to 5 minutes, and the WAKEUP_LOCATOR alarm was greatly reduced. Nonetheless, the ALARM_WAKEUP_ACTIVITY_DETECTION alarm still is well over the 10/hour limit.

We use geofences with 100m radius and monitor the exit transition, as recommended here. I'm also using a bigger geofence with radius up to 2km to define when I need to reload the geofences, to avoid loading too many geofences at once.

Most recent tests were on Android 7.1 on Galaxy S8, but the scenario is regular on other devices. Does anyone have a similar problem? Google recommends using Geofences, especially in light of Oreo's restrictions on background location requests, so it is weird that a system monitoring tool is accounting for so much wakeups when it's the suggested way to avoid it.

Ps: I have read the Yvette Colomb answer here, And I'm not using Location Updates, only the Geofence services. Should I give up on it?

[Edit] The documentation for geofences on android can be seen here: https://developer.android.com/training/location/geofencing.html

[Edit 2] There is an issue on the Android tracker that is discussing this situation, but no new updates on that front either

[Edit 3]: The issue was assigned on the Google Issue tracker. on ~22/08/2018

Thanks for your attention,


Solution

  • Apparently this topic on Google's issue tracker was marked as fixed. I have yet to verify it though.