Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 54b7e6f8 authored by Ricki Hirner's avatar Ricki Hirner
Browse files

Minor update of dependencies and annotations

parent 162047dd
Loading
Loading
Loading
Loading
+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',
@@ -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}"
    }
+3 −0
Original line number Diff line number Diff line
@@ -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,
@@ -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()