Loading build.gradle +2 −2 Original line number Diff line number Diff line Loading @@ -30,12 +30,12 @@ apply plugin: 'kotlin-android' apply plugin: 'org.jetbrains.dokka' android { compileSdkVersion 30 compileSdkVersion 31 buildToolsVersion '30.0.3' defaultConfig { minSdkVersion 16 // Android 4.1 targetSdkVersion 30 // Android 11 targetSdkVersion 31 // Android 12 } compileOptions { Loading src/androidTest/java/at/bitfire/vcard4android/contactrow/EmailHandlerTest.kt +0 −1 Original line number Diff line number Diff line Loading @@ -3,7 +3,6 @@ package at.bitfire.vcard4android.contactrow import android.content.ContentValues import android.provider.ContactsContract.CommonDataKinds.Email import at.bitfire.vcard4android.Contact import at.bitfire.vcard4android.datavalues.EmailHandler import at.bitfire.vcard4android.property.CustomType import ezvcard.parameter.EmailType import org.junit.Assert.* Loading src/androidTest/java/at/bitfire/vcard4android/contactrow/PhotoHandlerTest.kt +0 −1 Original line number Diff line number Diff line Loading @@ -3,7 +3,6 @@ package at.bitfire.vcard4android.contactrow import android.content.ContentValues import android.provider.ContactsContract.CommonDataKinds.Photo import at.bitfire.vcard4android.Contact import at.bitfire.vcard4android.datavalues.PhotoHandler import org.junit.Assert.assertEquals import org.junit.Assert.assertNull import org.junit.Test Loading src/main/java/at/bitfire/vcard4android/AndroidContact.kt +2 −15 Original line number Diff line number Diff line Loading @@ -150,9 +150,9 @@ open class AndroidContact( // - We'll only delete rows we have inserted so that unknown rows like // vnd.android.cursor.item/important_people (= contact is in Samsung "edge panel") remain untouched. val typesToRemove = processor.builderMimeTypes() val sqlTypesToRemove = typesToRemove.map { mimeType -> val sqlTypesToRemove = typesToRemove.joinToString(",") { mimeType -> DatabaseUtils.sqlEscapeString(mimeType) }.joinToString(",") } batch.enqueue(BatchOperation.CpoBuilder .newDelete(dataSyncURI()) .withSelection(Data.RAW_CONTACT_ID + "=? AND ${Data.MIMETYPE} IN ($sqlTypesToRemove)", arrayOf(id!!.toString()))) Loading Loading @@ -205,19 +205,6 @@ open class AndroidContact( // helpers protected fun insertDataBuilder(rawContactKeyName: String): BatchOperation.CpoBuilder { val builder = BatchOperation.CpoBuilder.newInsert(dataSyncURI()) if (id == null) builder.withValueBackReference(rawContactKeyName, 0) else builder.withValue(rawContactKeyName, id) if (addressBook.readOnly) builder.withValue(Data.IS_READ_ONLY, 1) return builder } protected fun rawContactSyncURI(): Uri { val id = requireNotNull(id) return addressBook.syncAdapterURI(ContentUris.withAppendedId(RawContacts.CONTENT_URI, id)) Loading src/main/java/at/bitfire/vcard4android/BatchOperation.kt +1 −1 Original line number Diff line number Diff line Loading @@ -87,7 +87,7 @@ class BatchOperation( * @param end index of last operation which will be run (exclusive!) * @throws RemoteException on calendar provider errors * @throws OperationApplicationException when the batch can't be processed * @throws CalendarStorageException if the transaction is too large * @throws ContactsStorageException if the transaction is too large */ private fun runBatch(start: Int, end: Int) { if (end == start) Loading Loading
build.gradle +2 −2 Original line number Diff line number Diff line Loading @@ -30,12 +30,12 @@ apply plugin: 'kotlin-android' apply plugin: 'org.jetbrains.dokka' android { compileSdkVersion 30 compileSdkVersion 31 buildToolsVersion '30.0.3' defaultConfig { minSdkVersion 16 // Android 4.1 targetSdkVersion 30 // Android 11 targetSdkVersion 31 // Android 12 } compileOptions { Loading
src/androidTest/java/at/bitfire/vcard4android/contactrow/EmailHandlerTest.kt +0 −1 Original line number Diff line number Diff line Loading @@ -3,7 +3,6 @@ package at.bitfire.vcard4android.contactrow import android.content.ContentValues import android.provider.ContactsContract.CommonDataKinds.Email import at.bitfire.vcard4android.Contact import at.bitfire.vcard4android.datavalues.EmailHandler import at.bitfire.vcard4android.property.CustomType import ezvcard.parameter.EmailType import org.junit.Assert.* Loading
src/androidTest/java/at/bitfire/vcard4android/contactrow/PhotoHandlerTest.kt +0 −1 Original line number Diff line number Diff line Loading @@ -3,7 +3,6 @@ package at.bitfire.vcard4android.contactrow import android.content.ContentValues import android.provider.ContactsContract.CommonDataKinds.Photo import at.bitfire.vcard4android.Contact import at.bitfire.vcard4android.datavalues.PhotoHandler import org.junit.Assert.assertEquals import org.junit.Assert.assertNull import org.junit.Test Loading
src/main/java/at/bitfire/vcard4android/AndroidContact.kt +2 −15 Original line number Diff line number Diff line Loading @@ -150,9 +150,9 @@ open class AndroidContact( // - We'll only delete rows we have inserted so that unknown rows like // vnd.android.cursor.item/important_people (= contact is in Samsung "edge panel") remain untouched. val typesToRemove = processor.builderMimeTypes() val sqlTypesToRemove = typesToRemove.map { mimeType -> val sqlTypesToRemove = typesToRemove.joinToString(",") { mimeType -> DatabaseUtils.sqlEscapeString(mimeType) }.joinToString(",") } batch.enqueue(BatchOperation.CpoBuilder .newDelete(dataSyncURI()) .withSelection(Data.RAW_CONTACT_ID + "=? AND ${Data.MIMETYPE} IN ($sqlTypesToRemove)", arrayOf(id!!.toString()))) Loading Loading @@ -205,19 +205,6 @@ open class AndroidContact( // helpers protected fun insertDataBuilder(rawContactKeyName: String): BatchOperation.CpoBuilder { val builder = BatchOperation.CpoBuilder.newInsert(dataSyncURI()) if (id == null) builder.withValueBackReference(rawContactKeyName, 0) else builder.withValue(rawContactKeyName, id) if (addressBook.readOnly) builder.withValue(Data.IS_READ_ONLY, 1) return builder } protected fun rawContactSyncURI(): Uri { val id = requireNotNull(id) return addressBook.syncAdapterURI(ContentUris.withAppendedId(RawContacts.CONTENT_URI, id)) Loading
src/main/java/at/bitfire/vcard4android/BatchOperation.kt +1 −1 Original line number Diff line number Diff line Loading @@ -87,7 +87,7 @@ class BatchOperation( * @param end index of last operation which will be run (exclusive!) * @throws RemoteException on calendar provider errors * @throws OperationApplicationException when the batch can't be processed * @throws CalendarStorageException if the transaction is too large * @throws ContactsStorageException if the transaction is too large */ private fun runBatch(start: Int, end: Int) { if (end == start) Loading