-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make sync interval more reliable #16
Comments
The reason for this is that the This is fine if we're concerned about phone battery life, but the way sync intervals can be selected suggests different behaviour. It may be a good idea to switch APIs. This blog post has more details. |
It seems like alarm managers are the way to go. |
To sync as regularly as the app settings suggest, something like An alarm should be schedule if all of the following conditions apply:
Rescheduling (which might entail cancelling an existing alarm altogether) should take place in these situations:
An alarm will need to be handled a bit more carefully as well since the system might go back into idling while we're sending our message. We may need to acquire an explicit wake lock which is only released once we're done syncing. |
Link collection so I don't forget: |
As it is now, starting the app initiates a sync attempt. This should not be the case: starting the app should not interfere with the standard sync cycle.
The text was updated successfully, but these errors were encountered: