Closed aakash1313 closed 4 years ago
The Service encapsulates two tasks: The PullFromServerTask which runs once an hour (this polls server for exposure notifications + narrowcast messages) The LogPurgerTask which runs once a day (deletes old data, so we only retain latest 14 days of data)
I am guessing you need a service constantly running for this to happen. But if you know of other ways to do this that is less power hungry, please post them.
@justinklchan : I think it seems to be a deferrable task, how about if we let work manager perform it for us. It will take care of the battery constraints and other constraints for us. Since this doesn't require to be run continuously (like location logging ), as a best practice for background process, work manager will handle it efficiently for us.
Let me know what you think about it?
This seems good, just read a little about WorkManager. As long as you can set the constraint to run at particular time intervals (doesn't have to be exact), that is fine. For example for the Pull task we can check for network connectivity. And also check for low battery for both tasks. Please add it.
@justinklchan : This is done, should we close this?
let me verify
@justinklchan : Do we want this service to be always running in background?