I am encountering a
SecurityException crash on Android 8 with
targetSDK 26 when using
This is from JobIntentService docs:
So What is the maximumJobExecution time limit – and if we exceed it – will it possible that a SecurityException will be thrown?
I’ve manually tested it, the maximum execution time is
600 seconds, which means
10minutes. 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.
I’ve noticed, that after a while the service stops or Android puts it to sleep. So let’s say, 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.
Answered By – Desolator
Answer Checked By – Senaida (Easybugfix Volunteer)