Skip to content
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

Draft
wants to merge 3 commits into
base: main-ose
Choose a base branch
from

Conversation

sunkup
Copy link
Member

@sunkup sunkup commented Nov 21, 2024

Todo:

  • Fix tests with missing mockks
  • add tests?

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 via the sync framework API ContentResolver. 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

  • Create SyncFrameworkIntegration class with all necessary methods.
  • Use it everywhere ContentResolver calls are made, except for in the migrations

Note that due to the Android 7 upload work-around there are still several where ContentResolver.SYNC_EXTRAS_UPLOAD is in use.

Checklist

  • The PR has a proper title, description and label.
  • I have self-reviewed the PR.
  • I have added documentation to complex functions and functions that can be used by other modules.
  • I have added reasonable tests or consciously decided to not add tests.

@sunkup sunkup added the refactoring Internal improvement of existing functions label Nov 21, 2024
@sunkup sunkup self-assigned this Nov 21, 2024
@sunkup sunkup linked an issue Nov 21, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Internal improvement of existing functions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Architecture] Do sync framework integration in a separate class
1 participant