Revert to backward compatible query

This commit is contained in:
Naveen 2022-06-22 00:53:29 +05:30
parent b70ccfa183
commit 91225ba802

View File

@ -65,11 +65,17 @@ class RecentsHelper(private val context: Context) {
accountIdToSimIDMap[it.handle.id] = it.id
}
val cursor = if (isRPlus()) {
val bundle = Bundle().apply {
putStringArray(ContentResolver.QUERY_ARG_SORT_COLUMNS, arrayOf(Calls._ID))
putInt(ContentResolver.QUERY_ARG_SORT_DIRECTION, ContentResolver.QUERY_SORT_DIRECTION_DESCENDING)
}
val cursor = context.contentResolver.query(uri, projection, bundle, null)
context.contentResolver.query(uri, projection, bundle, null)
} else {
val sortOrder = "${Calls._ID} DESC"
context.contentResolver.query(uri, projection, null, null, sortOrder)
}
val contactsWithMultipleNumbers = contacts.filter { it.phoneNumbers.size > 1 }
val numbersToContactIDMap = HashMap<String, Int>()