mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-06-05 21:59:27 +02:00
fix a glitch with casual Phone Storage not being visible
This commit is contained in:
@@ -810,12 +810,17 @@ class ContactsHelper(val context: Context) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var hadEmptyAccount = false
|
||||||
val contentResolverAccounts = getContentResolverAccounts().filter {
|
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))
|
it.name.isNotEmpty() && it.type.isNotEmpty() && !accounts.contains(Account(it.name, it.type))
|
||||||
}
|
}
|
||||||
sources.addAll(contentResolverAccounts)
|
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)))
|
sources.add(ContactSource("", "", context.getString(R.string.phone_storage)))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user