Search code examples
androidandroid-geofenceandroid-doze

Doze mode sleeps Google's Geofence sample application


I have an android application that uses Geofence and I'm having a hard time overcoming Doze mode. My manifest has the WAKE_LOCK permission and seven setNotificationResponsiveness to 0 for each region. I even changed PendingIntent to BroadcastReceiver but the app literally sleeps or is dead after a while with the deleted smartphone screen. I've already tried using LocationRequest

LocationRequest.setFastestInterval(1000);
LocationRequest.setInterval(2000);

Even so, I did not succeed. Has anyone managed to keep the application running with the Doze?


Solution

  • I ended up putting my application to receive push messages. Apparently the app is no longer being killed by the operating system.