From fc837af84f68e41a14ba9933bf524acb090db5f6 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 10 Apr 2022 22:54:14 +0200 Subject: [PATCH] avoid showing both Phone and Phone Storage as available options --- .../contacts/pro/helpers/ContactsHelper.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/ContactsHelper.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/ContactsHelper.kt index 5781b4e7..6365ff0e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/ContactsHelper.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/ContactsHelper.kt @@ -23,7 +23,6 @@ import com.simplemobiletools.contacts.pro.models.Email import com.simplemobiletools.contacts.pro.models.Event import com.simplemobiletools.contacts.pro.models.Organization import java.util.* -import kotlin.collections.ArrayList class ContactsHelper(val context: Context) { private val BATCH_SIZE = 50 @@ -811,8 +810,9 @@ class ContactsHelper(val context: Context) { } var hadEmptyAccount = false - val contentResolverAccounts = getContentResolverAccounts().filter { - if (it.name.isEmpty() && it.type.isEmpty()) { + val allAccounts = getContentResolverAccounts() + val contentResolverAccounts = allAccounts.filter { + if (it.name.isEmpty() && it.type.isEmpty() && allAccounts.none { it.name.lowercase(Locale.getDefault()) == "phone" }) { hadEmptyAccount = true }