mirror of
https://github.com/SimpleMobileTools/Simple-SMS-Messenger.git
synced 2025-01-01 02:57:27 +01:00
minor code cleanup
This commit is contained in:
parent
3cd84e42bc
commit
de57cc3085
@ -1,12 +1,9 @@
|
|||||||
package com.simplemobiletools.smsmessenger.helpers
|
package com.simplemobiletools.smsmessenger.helpers
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.net.Uri
|
|
||||||
import android.provider.Telephony.*
|
import android.provider.Telephony.*
|
||||||
import android.util.Log
|
|
||||||
import com.google.gson.Gson
|
import com.google.gson.Gson
|
||||||
import com.google.gson.reflect.TypeToken
|
import com.google.gson.reflect.TypeToken
|
||||||
import com.simplemobiletools.commons.extensions.queryCursor
|
|
||||||
import com.simplemobiletools.commons.extensions.showErrorToast
|
import com.simplemobiletools.commons.extensions.showErrorToast
|
||||||
import com.simplemobiletools.commons.helpers.ensureBackgroundThread
|
import com.simplemobiletools.commons.helpers.ensureBackgroundThread
|
||||||
import com.simplemobiletools.smsmessenger.extensions.*
|
import com.simplemobiletools.smsmessenger.extensions.*
|
||||||
@ -44,6 +41,7 @@ class MessagesImporter(private val context: Context) {
|
|||||||
callback.invoke(IMPORT_NOTHING_NEW)
|
callback.invoke(IMPORT_NOTHING_NEW)
|
||||||
return@ensureBackgroundThread
|
return@ensureBackgroundThread
|
||||||
}
|
}
|
||||||
|
|
||||||
onProgress.invoke(totalMessages, messagesImported)
|
onProgress.invoke(totalMessages, messagesImported)
|
||||||
for (message in messages) {
|
for (message in messages) {
|
||||||
if (config.importSms) {
|
if (config.importSms) {
|
||||||
@ -70,9 +68,7 @@ class MessagesImporter(private val context: Context) {
|
|||||||
|
|
||||||
callback.invoke(
|
callback.invoke(
|
||||||
when {
|
when {
|
||||||
messagesImported == 0 -> {
|
messagesImported == 0 -> IMPORT_FAIL
|
||||||
IMPORT_FAIL
|
|
||||||
}
|
|
||||||
messagesFailed > 0 -> IMPORT_PARTIAL
|
messagesFailed > 0 -> IMPORT_PARTIAL
|
||||||
else -> IMPORT_OK
|
else -> IMPORT_OK
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user