Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade vcard4android #1093

Conversation

ArnyminerZ
Copy link
Member

Purpose

Rename all occurences of account to addressBookAccount so that address book accounts won't be confused with DAVx5 accounts that easy.

Short description

Upgraded vcard4android to the latest version available (also upgrades compileSdk to 35).

Checklist

  • The PR has a proper title, description and label.
  • I have self-reviewed the PR.
  • I have added documentation to complex functions and functions that can be used by other modules.
  • I have added reasonable tests or consciously decided to not add tests.

Signed-off-by: Arnau Mora Gras <[email protected]>
@ArnyminerZ ArnyminerZ linked an issue Oct 22, 2024 that may be closed by this pull request
@ArnyminerZ ArnyminerZ self-assigned this Oct 22, 2024
@ArnyminerZ ArnyminerZ added the refactoring Internal improvement of existing functions label Oct 22, 2024
@ArnyminerZ ArnyminerZ marked this pull request as ready for review October 22, 2024 05:57
Signed-off-by: Arnau Mora Gras <[email protected]>
Signed-off-by: Arnau Mora Gras <[email protected]>
Signed-off-by: Arnau Mora Gras <[email protected]>
Signed-off-by: Arnau Mora Gras <[email protected]>
@@ -23,7 +23,7 @@ android {

setProperty("archivesBaseName", "davx5-ose-$versionName")

minSdk = 24 // Android 7.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be done in #1090.

@@ -85,7 +84,7 @@ open class LocalAddressBook @AssistedInject constructor(
*/
open val groupMethod: GroupMethod by lazy {
val manager = AccountManager.get(context)
val associatedAccount = manager.getUserData(/* address book account */ account, USER_DATA_COLLECTION_ID)?.toLongOrNull()?.let { collectionId ->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now there's addressBookAccount in the constructor and as a property. These can be confused and make a difference. Using addressBookAccount from the constructor would be bad here because the account could have been renamed and only the addressBookAccount property contains the correct account.

So I suggest to rename the constructur argument to _addressBookAccount for clarity and add the explanation with renaming in its KDoc.

Comment on lines -148 to -158
override fun prepare(): Boolean {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
// workaround for Android 7 which sets DIRTY flag when only meta-data is changed
val reallyDirty = localCollection.verifyDirty()
val deleted = localCollection.findDeleted().size
if (extras.contains(ContentResolver.SYNC_EXTRAS_UPLOAD) && reallyDirty == 0 && deleted == 0) {
logger.info("This sync was called to up-sync dirty/deleted contacts, but no contacts have been changed")
return false
}
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit confused – shouldn't that be done in #1090, too?

This PR should only update vcard4android so that the account fields are renamed to addressBookAccount.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit confused – shouldn't that be done in #1090, too?

Yup, somehow I mixed the two PRs, I'll clean up this mess 😅

@ArnyminerZ
Copy link
Member Author

Replaced by #1095

@ArnyminerZ ArnyminerZ closed this Oct 22, 2024
@ArnyminerZ ArnyminerZ deleted the 1086-localaddressbook-rename-account-to-addressbookaccount branch October 22, 2024 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Internal improvement of existing functions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LocalAddressBook: rename account to addressBookAccount
2 participants