mirror of
https://github.com/etesync/android
synced 2025-06-07 16:49: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:
parent
00a1a223d0
commit
97d1a40e49
@ -91,12 +91,14 @@ class LocalAddressBook(
|
|||||||
|
|
||||||
|
|
||||||
val addressBook = LocalAddressBook(context, account, provider)
|
val addressBook = LocalAddressBook(context, account, provider)
|
||||||
|
ContentResolver.setIsSyncable(account, ContactsContract.AUTHORITY, 1)
|
||||||
ContentResolver.setSyncAutomatically(account, ContactsContract.AUTHORITY, true)
|
ContentResolver.setSyncAutomatically(account, ContactsContract.AUTHORITY, true)
|
||||||
|
|
||||||
val values = ContentValues(2)
|
val values = ContentValues(2)
|
||||||
values.put(ContactsContract.Settings.SHOULD_SYNC, 1)
|
values.put(ContactsContract.Settings.SHOULD_SYNC, 1)
|
||||||
values.put(ContactsContract.Settings.UNGROUPED_VISIBLE, 1)
|
values.put(ContactsContract.Settings.UNGROUPED_VISIBLE, 1)
|
||||||
addressBook.settings = values
|
addressBook.settings = values
|
||||||
|
addressBook.readOnly = col.accessLevel == "ro"
|
||||||
|
|
||||||
return addressBook
|
return addressBook
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user