Android O Background service runs for more than 30 minutes. What for?

I use the FusedLocationProvider API to register some Geofences with PendingIntent when my application launches (the application was killed manually to trigger this behavior) through the Geofence event, I start the background service to do some work.

In this service, I create a separate background thread to perform some lengthy tasks, and I get a tracking lock, so I'm sure my tasks are complete. The service works for a longer period of time (30-50 minutes), although this should not be. It should not be white and continue to work for a longer period of time in accordance with my understanding of the latest changes in Android O.

This is the desired behavior or some error with PendingIntents waking up the application, and then it is treated as white, even if these intentions are not intended for notifications (that is, everything that the user can see).

Or, these intentions are categorized as "Receive Broadcast, for example, SMS / MMS." as mentioned here in the documentation

+4
source share
1 answer

This is my error in the preview.

But, are you sure that your service works after 1 minute? Your application process and the background thread you made will / can start even after the service is destroyed.

, onDestroy callback, . , , Android , .

0

Source: https://habr.com/ru/post/1676828/


All Articles