From faf6a8597af426ee73221f7d6398684bfd5613ae Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 24 Mar 2022 10:31:18 +0100 Subject: [PATCH] fix a glitch with casual Phone Storage not being visible --- .../contacts/pro/helpers/ContactsHelper.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 bdf62c02..51c394d0 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 @@ -810,12 +810,17 @@ class ContactsHelper(val context: Context) { } } + var hadEmptyAccount = false val contentResolverAccounts = getContentResolverAccounts().filter { + if (it.name.isEmpty() && it.type.isEmpty()) { + hadEmptyAccount = true + } + it.name.isNotEmpty() && it.type.isNotEmpty() && !accounts.contains(Account(it.name, it.type)) } sources.addAll(contentResolverAccounts) - if (!sources.any { it.type.startsWith("com.google") || it.type.startsWith("com.android") || it.type.startsWith("com.qualcomm") }) { + if (hadEmptyAccount) { sources.add(ContactSource("", "", context.getString(R.string.phone_storage))) }