forked from upstream-mirrors/quik
Remove unnecessary constructor
This commit is contained in:
@@ -12,9 +12,4 @@ open class Contact() : RealmObject() {
|
|||||||
|
|
||||||
var inContactsTable: Boolean = false
|
var inContactsTable: Boolean = false
|
||||||
|
|
||||||
constructor(id: Long, address: String) : this() {
|
|
||||||
this.recipientId = id
|
|
||||||
this.address = address
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -62,7 +62,10 @@ class ContactRepository @Inject constructor(val context: Context) {
|
|||||||
private fun getContactFromDb(recipientId: Long): Contact? {
|
private fun getContactFromDb(recipientId: Long): Contact? {
|
||||||
context.contentResolver.query(Uri.withAppendedPath(URI, recipientId.toString()), null, null, null, null)?.use { recipientCursor ->
|
context.contentResolver.query(Uri.withAppendedPath(URI, recipientId.toString()), null, null, null, null)?.use { recipientCursor ->
|
||||||
if (recipientCursor.moveToFirst()) {
|
if (recipientCursor.moveToFirst()) {
|
||||||
val contact = Contact(recipientId, recipientCursor.getString(0))
|
val contact = Contact().apply {
|
||||||
|
this.recipientId = recipientId
|
||||||
|
this.address = recipientCursor.getString(0)
|
||||||
|
}
|
||||||
|
|
||||||
val contactUri = Uri.withAppendedPath(ContactsContract.PhoneLookup.CONTENT_FILTER_URI, Uri.encode(contact.address))
|
val contactUri = Uri.withAppendedPath(ContactsContract.PhoneLookup.CONTENT_FILTER_URI, Uri.encode(contact.address))
|
||||||
val projection = arrayOf(BaseColumns._ID, ContactsContract.PhoneLookup.DISPLAY_NAME, ContactsContract.PhoneLookup.LOOKUP_KEY)
|
val projection = arrayOf(BaseColumns._ID, ContactsContract.PhoneLookup.DISPLAY_NAME, ContactsContract.PhoneLookup.LOOKUP_KEY)
|
||||||
|
|||||||
Reference in New Issue
Block a user