For devices targeting API < 26, I have a service which remains the background until it receives a signal to do work. At that point, the service notifies the user and moves itself to the foreground, where it will complete its task and withdraw back into the background.
My problem is that sometimes, the service will not complete the task after receiving the signal. I am in the process of troubleshooting the cause, but assuming it's not a case of internal life cycle error (crash, stopSelf()
, etc...), is there any possibility that the system shuts down my service permanently without restarting it?
I am not ruling out the case of internal error, but it would help me to narrow down my search. I know that the system should restart the service in case it's low on memory (which I don't think is the case here). Keep in mind that API >= 26 has a different implementation, and as a last resort would be adopted for lower versions, but I would like to avoid that.
I apologise in advance for being as vague as possible.