During a rename address book operation (renameAccount()), LocalAddressBook doesn't call updateSyncFrameworkSettings() when creating address books. This may cause one or two extra unnecessary syncs from the sync framework. It fixes itself anyway because sooner or later LocalAddressBook.update() will be called, which in turn calls updateSyncFrameworkSettings.
LocalAddressBook.create()does call updateSyncFrameworkSettings, but create() is not used by renameAccount(). Shared code should be in a separate method.
addressBook.settings (ContactsContract.Settings.SHOULD_SYNC and UNGROUPED_VISIBLE) are also not set when address books are created during renaming or when address books are updated.
addressBook.readOnly is also not set when renamed, but at least when updated.
It should be exactly documented in which state an address book account should be and how and when it gets into that state.
[x] #1112
[x] #1113
[x] #1114
Currently, when address books are updated, readOnly is only updated when forceReadOnly != null. However readOnly should always be calculated and the nowReadOnly != readOnly block executed, if applicable.
During a rename address book operation (
renameAccount()
),LocalAddressBook
doesn't callupdateSyncFrameworkSettings()
when creating address books. This may cause one or two extra unnecessary syncs from the sync framework. It fixes itself anyway because sooner or laterLocalAddressBook.update()
will be called, which in turn callsupdateSyncFrameworkSettings
.LocalAddressBook.create()
does callupdateSyncFrameworkSettings
, butcreate()
is not used byrenameAccount()
. Shared code should be in a separate method.addressBook.settings
(ContactsContract.Settings.SHOULD_SYNC
andUNGROUPED_VISIBLE
) are also not set when address books are created during renaming or when address books are updated.addressBook.readOnly
is also not set when renamed, but at least when updated.It should be exactly documented in which state an address book account should be and how and when it gets into that state.
readOnly
is only updated whenforceReadOnly != null
. HoweverreadOnly
should always be calculated and thenowReadOnly != readOnly
block executed, if applicable.