From ef3a61714a96289481692d1718e427b9576e0cf9 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 26 Oct 2018 13:40:00 +0200 Subject: [PATCH] create some constants for apps with special handling --- .../com/simplemobiletools/contacts/extensions/Activity.kt | 6 +++--- .../com/simplemobiletools/contacts/helpers/Constants.kt | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/extensions/Activity.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/extensions/Activity.kt index 90a18c9a..64c5402b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/extensions/Activity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/extensions/Activity.kt @@ -63,9 +63,9 @@ fun SimpleActivity.startCall(contact: Contact) { fun SimpleActivity.showContactSourcePicker(currentSource: String, callback: (newSource: String) -> Unit) { ContactsHelper(this).getContactSources { val ignoredTypes = arrayListOf( - "org.thoughtcrime.securesms", // Signal - "org.telegram.messenger", // Telegram - "com.whatsapp" // WhatsApp + SIGNAL_PACKAGE, + TELEGRAM_PACKAGE, + WHATSAPP_PACKAGE ) val items = ArrayList() diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/helpers/Constants.kt index 58309511..859347fd 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/helpers/Constants.kt @@ -113,3 +113,8 @@ val localAccountTypes = arrayListOf("vnd.sec.contact.phone", "com.android.huawei.phone", "Local Phone Account" ) + +// apps with special handling +const val TELEGRAM_PACKAGE = "org.telegram.messenger" +const val SIGNAL_PACKAGE = "org.thoughtcrime.securesms" +const val WHATSAPP_PACKAGE = "com.whatsapp"