Loading build.gradle +2 −2 Original line number Diff line number Diff line buildscript { ext.versions = [ kotlin: '1.5.21', kotlin: '1.5.31', dokka: '1.5.0', // latest Apache Commons versions that don't require Java 8 (Android 7) commonsIO: '2.6', Loading @@ -14,7 +14,7 @@ buildscript { } dependencies { classpath 'com.android.tools.build:gradle:7.0.1' classpath 'com.android.tools.build:gradle:7.0.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}" classpath "org.jetbrains.dokka:dokka-gradle-plugin:${versions.dokka}" } Loading src/main/java/at/bitfire/vcard4android/AndroidAddressBook.kt +3 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ import android.provider.ContactsContract.RawContacts import at.bitfire.vcard4android.Utils.toContentValues import java.io.FileNotFoundException import java.util.* import kotlin.jvm.Throws open class AndroidAddressBook<T1: AndroidContact, T2: AndroidGroup>( var account: Account, Loading Loading @@ -80,12 +81,14 @@ open class AndroidAddressBook<T1: AndroidContact, T2: AndroidGroup>( return groups } @Throws(FileNotFoundException::class) fun findContactById(id: Long) = queryContacts("${RawContacts._ID}=?", arrayOf(id.toString())).firstOrNull() ?: throw FileNotFoundException() fun findContactByUid(uid: String) = queryContacts("${AndroidContact.COLUMN_UID}=?", arrayOf(uid)).firstOrNull() @Throws(FileNotFoundException::class) fun findGroupById(id: Long) = queryGroups("${Groups._ID}=?", arrayOf(id.toString())).firstOrNull() ?: throw FileNotFoundException() Loading Loading
build.gradle +2 −2 Original line number Diff line number Diff line buildscript { ext.versions = [ kotlin: '1.5.21', kotlin: '1.5.31', dokka: '1.5.0', // latest Apache Commons versions that don't require Java 8 (Android 7) commonsIO: '2.6', Loading @@ -14,7 +14,7 @@ buildscript { } dependencies { classpath 'com.android.tools.build:gradle:7.0.1' classpath 'com.android.tools.build:gradle:7.0.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}" classpath "org.jetbrains.dokka:dokka-gradle-plugin:${versions.dokka}" } Loading
src/main/java/at/bitfire/vcard4android/AndroidAddressBook.kt +3 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ import android.provider.ContactsContract.RawContacts import at.bitfire.vcard4android.Utils.toContentValues import java.io.FileNotFoundException import java.util.* import kotlin.jvm.Throws open class AndroidAddressBook<T1: AndroidContact, T2: AndroidGroup>( var account: Account, Loading Loading @@ -80,12 +81,14 @@ open class AndroidAddressBook<T1: AndroidContact, T2: AndroidGroup>( return groups } @Throws(FileNotFoundException::class) fun findContactById(id: Long) = queryContacts("${RawContacts._ID}=?", arrayOf(id.toString())).firstOrNull() ?: throw FileNotFoundException() fun findContactByUid(uid: String) = queryContacts("${AndroidContact.COLUMN_UID}=?", arrayOf(uid)).firstOrNull() @Throws(FileNotFoundException::class) fun findGroupById(id: Long) = queryGroups("${Groups._ID}=?", arrayOf(id.toString())).firstOrNull() ?: throw FileNotFoundException() Loading