forked from upstream-mirrors/quik
fix(contacts): Fix a potential memory leak in contact lookup
This commit is contained in:
@@ -177,7 +177,15 @@ class ContactRepositoryImpl @Inject constructor(
|
|||||||
} else {
|
} else {
|
||||||
uri = Uri.withAppendedPath(ContactsContract.PhoneLookup.CONTENT_FILTER_URI, Uri.encode(address))
|
uri = Uri.withAppendedPath(ContactsContract.PhoneLookup.CONTENT_FILTER_URI, Uri.encode(address))
|
||||||
}
|
}
|
||||||
return context.contentResolver.query(uri, arrayOf(BaseColumns._ID), null, null, null)?.count!! > 0
|
return context.contentResolver.query(
|
||||||
|
uri,
|
||||||
|
arrayOf(BaseColumns._ID),
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
)?.use { cursor ->
|
||||||
|
cursor.count > 0
|
||||||
|
} ?: false
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user