Sort the call history before restoring, so that it is saved in the right order

This commit is contained in:
merkost
2023-07-01 12:04:07 +10:00
parent ec57e45770
commit 7f2fa6cf7e

View File

@@ -226,7 +226,9 @@ class RecentsHelper(private val context: Context) {
activity.handlePermission(PERMISSION_WRITE_CALL_LOG) { activity.handlePermission(PERMISSION_WRITE_CALL_LOG) {
if (it) { if (it) {
ensureBackgroundThread { ensureBackgroundThread {
val values = objects.map { val values = objects
.sortedBy { it.startTS }
.map {
ContentValues().apply { ContentValues().apply {
put(Calls.NUMBER, it.phoneNumber) put(Calls.NUMBER, it.phoneNumber)
put(Calls.TYPE, it.type) put(Calls.TYPE, it.type)