From de57cc3085000ec9c9c7eab0f020b160f5579bee Mon Sep 17 00:00:00 2001 From: Tibor Kaputa Date: Wed, 22 Sep 2021 22:55:31 +0200 Subject: [PATCH] minor code cleanup --- .../smsmessenger/helpers/MessagesImporter.kt | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/helpers/MessagesImporter.kt b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/helpers/MessagesImporter.kt index 167b191c..4ff1f5b7 100644 --- a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/helpers/MessagesImporter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/helpers/MessagesImporter.kt @@ -1,12 +1,9 @@ package com.simplemobiletools.smsmessenger.helpers import android.content.Context -import android.net.Uri import android.provider.Telephony.* -import android.util.Log import com.google.gson.Gson import com.google.gson.reflect.TypeToken -import com.simplemobiletools.commons.extensions.queryCursor import com.simplemobiletools.commons.extensions.showErrorToast import com.simplemobiletools.commons.helpers.ensureBackgroundThread import com.simplemobiletools.smsmessenger.extensions.* @@ -44,6 +41,7 @@ class MessagesImporter(private val context: Context) { callback.invoke(IMPORT_NOTHING_NEW) return@ensureBackgroundThread } + onProgress.invoke(totalMessages, messagesImported) for (message in messages) { if (config.importSms) { @@ -70,9 +68,7 @@ class MessagesImporter(private val context: Context) { callback.invoke( when { - messagesImported == 0 -> { - IMPORT_FAIL - } + messagesImported == 0 -> IMPORT_FAIL messagesFailed > 0 -> IMPORT_PARTIAL else -> IMPORT_OK }