From 55a4adb275c372d69750c85976333ae6aafeee53 Mon Sep 17 00:00:00 2001 From: Ricki Hirner Date: Thu, 8 Jul 2021 11:29:02 +0200 Subject: Update dependencies and KDoc --- build.gradle | 8 ++++---- src/main/java/at/bitfire/vcard4android/AndroidContact.kt | 10 ++++++++++ src/main/java/at/bitfire/vcard4android/BatchOperation.kt | 5 +++++ 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index bf30a43..f55e57c 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ buildscript { ext.versions = [ - kotlin: '1.4.32', + kotlin: '1.5.10', dokka: '0.10.1', // latest Apache Commons versions that don't require Java 8 (Android 7) commonsIO: '2.6', @@ -14,7 +14,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:4.2.1' + classpath 'com.android.tools.build:gradle:4.2.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}" classpath "org.jetbrains.dokka:dokka-gradle-plugin:${versions.dokka}" } @@ -90,8 +90,8 @@ dependencies { exclude group: 'com.fasterxml.jackson.core' } - androidTestImplementation 'androidx.test:runner:1.3.0' - androidTestImplementation 'androidx.test:rules:1.3.0' + androidTestImplementation 'androidx.test:runner:1.4.0' + androidTestImplementation 'androidx.test:rules:1.4.0' testImplementation 'junit:junit:4.13.2' } diff --git a/src/main/java/at/bitfire/vcard4android/AndroidContact.kt b/src/main/java/at/bitfire/vcard4android/AndroidContact.kt index 4514862..acce3b6 100644 --- a/src/main/java/at/bitfire/vcard4android/AndroidContact.kt +++ b/src/main/java/at/bitfire/vcard4android/AndroidContact.kt @@ -519,6 +519,7 @@ open class AndroidContact( /** * Override this to handle custom data rows, for example to add additional * information to [contact]. + * * @param mimeType MIME type of the row * @param row values of the row */ @@ -585,6 +586,13 @@ open class AndroidContact( return uri } + /** + * Deletes an existing contact from the contacts provider. + * + * @return number of affected rows + * + * @throws RemoteException on contacts provider errors + */ fun delete() = addressBook.provider!!.delete(rawContactSyncURI(), null, null) @@ -609,7 +617,9 @@ open class AndroidContact( * Inserts the data rows for a given raw contact. * Override this (and call the super class!) to add custom data rows, * for example generated from some properties of [contact]. + * * @param batch batch operation used to insert the data rows + * * @throws RemoteException on contact provider errors */ @CallSuper diff --git a/src/main/java/at/bitfire/vcard4android/BatchOperation.kt b/src/main/java/at/bitfire/vcard4android/BatchOperation.kt index 1c8b936..0ac1109 100644 --- a/src/main/java/at/bitfire/vcard4android/BatchOperation.kt +++ b/src/main/java/at/bitfire/vcard4android/BatchOperation.kt @@ -41,6 +41,11 @@ class BatchOperation( return this } + /** + * Commits all operations from [queue] and then empties the queue. + * + * @return number of affected rows + */ fun commit(): Int { var affected = 0 if (!queue.isEmpty()) -- cgit v1.2.3