mirror of
https://github.com/SimpleMobileTools/Simple-Dialer.git
synced 2025-06-05 21:49:23 +02:00
Sort the call history before restoring, so that it is saved in the right order
This commit is contained in:
@@ -226,15 +226,17 @@ 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
|
||||||
ContentValues().apply {
|
.sortedBy { it.startTS }
|
||||||
put(Calls.NUMBER, it.phoneNumber)
|
.map {
|
||||||
put(Calls.TYPE, it.type)
|
ContentValues().apply {
|
||||||
put(Calls.DATE, it.startTS.toLong() * 1000L)
|
put(Calls.NUMBER, it.phoneNumber)
|
||||||
put(Calls.DURATION, it.duration)
|
put(Calls.TYPE, it.type)
|
||||||
put(Calls.CACHED_NAME, it.name)
|
put(Calls.DATE, it.startTS.toLong() * 1000L)
|
||||||
}
|
put(Calls.DURATION, it.duration)
|
||||||
}.toTypedArray()
|
put(Calls.CACHED_NAME, it.name)
|
||||||
|
}
|
||||||
|
}.toTypedArray()
|
||||||
|
|
||||||
context.contentResolver.bulkInsert(contentUri, values)
|
context.contentResolver.bulkInsert(contentUri, values)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user