1
0
mirror of https://github.com/etesync/android synced 2025-01-10 15:51:08 +00:00

AddressBook: set isSyncable=1 on creation and update readOnly

Set isSyncable=1 at creation (and not only after first sync)
This commit is contained in:
Tom Hacohen 2020-09-06 10:20:27 +03:00
parent 00a1a223d0
commit 97d1a40e49

View File

@ -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
}