Reputation: 2396
Work manager of course can run if the phone is runing and the app is in the background.
But what if I killed the APP, or switch off the screen of the phone? What is it affect to the WorkManager?
Upvotes: 1
Views: 1755
Reputation: 8371
Yes. That's the reason why WorkManager
has been designed.
Even if your device off and have a periodic work request, the system will take care of you worker once the device has been restarted.
This is well tested by the Android team, no need to test it.
However, there are 2 scenarios when the Worker doesn't get triggered:
For both scenarios, in order for the WorkManager
to be started you need to re-launch the closed app.
Take a look at the docs for more: https://developer.android.com/topic/libraries/architecture/workmanager
Upvotes: 3