Closed
Description
Providing the respective database Collection
to the SyncManager
will allow us to reduce our dependency of the content providers.
For instance, we can then take the address book/calendar URL from the DB Collection.url
field instead of caching it in the content provider and then taking it from there.
Right now, we have two main steps in the Syncer
(let's take the CalendarSyncer
as an example):
- (Do some other stuff, like handling colors.)
updateLocalCalendars
: sync the DB collections of type "calendar" with the Android content provider (the collections themselves, not the contents)- Create local calendars (= calendar in the content provider) for syncable collections that don't have a local calendar yet.
- Update existing local calendars according to database and settings (title, URL, read/only flag, colors, …).
- Delete existing local calendars that shall not be synced (anymore).
- Iterate through all local calendars and sync them with a
CalendarSyncManager
. In this step, we don't have the DB collection anymore, so we can't pass it to theSyncManager
.
Now we want the DB collection to be available for the SyncManager
. My approach would be to combine the main steps in the Syncer
:
- (Do some other stuff, if necessary.)
- Sync list of DB collections with local calendars (the collections themselves, not the contents):
- Create/update local calendar according to the database when needed like we already do.
- Still in the same scope, we still have the DB collection and can pass it to the
SyncManager
. So we call theSyncManager
here and pass the DBCollection
. - Delete existing local calendars that shall not be synced (anymore).
Metadata
Metadata
Assignees
Type
Projects
Status
Done