what is the maximum job execution time of onHandleWork() of JobIntentService?

后端 未结 1 1572
独厮守ぢ
独厮守ぢ 2021-01-21 23:37

I am encountering a SecurityException crash on Android 8 with targetSDK 26 when using JobIntentService.

This is from JobIntentSer

相关标签:
1条回答
  • 2021-01-22 00:34

    I've manually tested it, the max execution time is 600 seconds which means 10 mins. What happens next is the JobIntentService gets destroyed then re-created to resume the rest of the work. This has been tested from Android Marshmallow to Android Oreo . I also haven't experienced any thrown exception, I'm also using Thread.Sleep() method to simulate a long process.

    Update 1: I've noticed that after a while the service stops or android puts it to sleep. so let's say if you're doing constant checks in the background i.e. api calls to get latest data to push notifications. it works for a while then stops after a day or 2.. I'm not sure why it randomly stops..

    0 讨论(0)
提交回复
热议问题