JobService doesn't stop after calling FirebaseJobDispatcher.cancel()

23 views Asked by At

I have JobService where I register broadcast receiver to listen to screen on/off events. The registration happens in onStartJob(). If I leave the device idle for a couple of minutes, and then call cancel("jobTag") of FirebaseJobDispatcher, I see that onDestory() and onStopJob() are called. However, if I leave the device idle for a few hours, if I call cancel("jobTag"), I don't see the calls for onDestory() and onStopJob() and the JobService continues to run. How can stop the JobService even if the device was idle for hours?

0

There are 0 answers