diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/helpers/ContactsHelper.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/helpers/ContactsHelper.kt index 079cc8ae..6b52f1bf 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/helpers/ContactsHelper.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/helpers/ContactsHelper.kt @@ -637,12 +637,16 @@ class ContactsHelper(val activity: BaseSimpleActivity) { fun getContactSources(callback: (ArrayList) -> Unit) { Thread { - val sources = getDeviceContactSources() - sources.add(ContactSource(activity.getString(R.string.phone_storage_hidden), SMT_PRIVATE)) - callback(ArrayList(sources)) + callback(getContactSourcesSync()) }.start() } + private fun getContactSourcesSync(): ArrayList { + val sources = getDeviceContactSources() + sources.add(ContactSource(activity.getString(R.string.phone_storage_hidden), SMT_PRIVATE)) + return ArrayList(sources) + } + private fun getDeviceContactSources(): LinkedHashSet { val sources = LinkedHashSet() if (!activity.hasContactPermissions()) {