Commit 69e6096a authored by Ricki Hirner's avatar Ricki Hirner 🐑

Contacts sync: check for sync conditions

parent 80971c52
Pipeline #28152421 failed with stages
in 8 minutes and 23 seconds
......@@ -39,6 +39,13 @@ class ContactsSyncAdapterService: SyncAdapterService() {
val addressBook = LocalAddressBook(context, account, provider)
val accountSettings = AccountSettings(context, settings, addressBook.mainAccount)
/* don't run sync if
- sync conditions (e.g. "sync only in WiFi") are not met AND
- this is is an automatic sync (i.e. manual syncs are run regardless of sync conditions)
if (!extras.containsKey(ContentResolver.SYNC_EXTRAS_MANUAL) && !checkSyncConditions(accountSettings))
// handle group method change
val groupMethod = accountSettings.getGroupMethod().name
accountSettings.accountManager.getUserData(account, PREVIOUS_GROUP_METHOD)?.let { previousGroupMethod ->
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment