Reputation: 1436
This is regarding how robust is android with delivering pending intents to services when it has to deal with phone restart. I'm more worried about reliability of pending intents in the work queue.
If persistence of pending intents are absent, i'm not sure it is reliable enough use pending intents, if we have long running service with sub tasks to be executed.
If the system kills the service after onStartCommand() returns, recreate the service and call onStartCommand() with the last intent that was delivered to the service. Any pending intents are delivered in turn. This is suitable for services that are actively performing a job that should be immediately resumed, such as downloading a file
Upvotes: 0
Views: 251
Reputation: 1006614
pending intents have a scope only in memory along as the android operating system is live ?
Yes.
Does pending intents have some amount of persistence to disk per app, during system restarts or shutdown, so that it is restored back ?
No. If you need work to survive a reboot, you need a persistent work queue. You might consider using Tape.
Upvotes: 1