bitfireAT / davx5-ose

DAVx⁵ is an open-source CalDAV/CardDAV suite and sync app for Android. You can also access your online files (WebDAV) with it.
https://www.davx5.com
GNU General Public License v3.0
1.57k stars 78 forks source link

`LocalAddressBook.renameAccount()` doesn't prepare accounts the same way as `create()` does #1111

Open rfc2822 opened 2 weeks ago

rfc2822 commented 2 weeks ago

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.