-
-
Notifications
You must be signed in to change notification settings - Fork 80
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
Extract sync framework interaction to separate class #1137
Extract sync framework interaction to separate class #1137
Conversation
0eb66c2
to
248eefb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some small things, otherwise looks good 😄
app/src/main/kotlin/at/bitfire/davdroid/sync/SyncFrameworkIntegration.kt
Outdated
Show resolved
Hide resolved
app/src/main/kotlin/at/bitfire/davdroid/sync/SyncFrameworkIntegration.kt
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks very good and I think it's a good starting point for possible improvements in the future. For instance now setIsSycnable
and setSyncOnContentChange
must be both called and you have to know that. In a future version it's maybe possible that we call methods more "blackbox" style without knowing such details. But this shouldn't be done in this PR.
Purpose
This is part of moving further away from the Sync Adapter Framework, which has been mostly replaced by Work Manager and is only used for sync requests coming from 3rd party apps and content changes.
While
SyncAdapterServices
is the entry point for said sync requests we are still en-/disabling general sync-ability and content triggered syncs for the sync framework viaContentResolver
calls. These calls should be made from a single central place.If we would ever like to change the notification of changed content provider entries to JobScheduler / WorkManager (https://github.com/bitfireAT/davx5/issues/247), it will be possible by adapting mainly this class and
SyncAdapterServices
.Short description
SyncFrameworkIntegration
class with all necessary methods.ContentResolver
calls are made, except in the migrationsNote that due to the Android 7 contacts upload work-around there are still several places where
ContentResolver.SYNC_EXTRAS_UPLOAD
is in use.Checklist