AddressBook: set isSyncable=1 on creation and update readOnly

Set isSyncable=1 at creation (and not only after first sync)
pull/131/head
Tom Hacohen 4 years ago
parent 00a1a223d0
commit 97d1a40e49

@ -91,12 +91,14 @@ class LocalAddressBook(
val addressBook = LocalAddressBook(context, account, provider)
ContentResolver.setIsSyncable(account, ContactsContract.AUTHORITY, 1)
ContentResolver.setSyncAutomatically(account, ContactsContract.AUTHORITY, true)
val values = ContentValues(2)
values.put(ContactsContract.Settings.SHOULD_SYNC, 1)
values.put(ContactsContract.Settings.UNGROUPED_VISIBLE, 1)
addressBook.settings = values
addressBook.readOnly = col.accessLevel == "ro"
return addressBook
}

Loading…
Cancel
Save