Added a hidden setting to disable prefering normalized phone numbes when importing contacts from native address book
This commit is contained in:
parent
06e07518bb
commit
4a4d5f5d74
2 changed files with 10 additions and 1 deletions
|
@ -118,7 +118,13 @@ class NativeContact(val nativeId: String, private val lookupKey: String? = null)
|
|||
label
|
||||
).toString()
|
||||
|
||||
val number = data4 ?: data1
|
||||
// data4 = ContactsContract.CommonDataKinds.Phone.NORMALIZED_NUMBER
|
||||
// data1 = ContactsContract.CommonDataKinds.Phone.NUMBER
|
||||
val number = if (corePreferences.preferNormalizedPhoneNumbersFromAddressBook) {
|
||||
data4 ?: data1
|
||||
} else {
|
||||
data1 ?: data4
|
||||
}
|
||||
if (number != null && number.isNotEmpty()) {
|
||||
Log.d("[Native Contact] Found phone number $data1 ($data4), type label is $typeLabel")
|
||||
if (!rawPhoneNumbers.contains(number)) {
|
||||
|
|
|
@ -424,6 +424,9 @@ class CorePreferences constructor(private val context: Context) {
|
|||
val fetchContactsFromDefaultDirectory: Boolean
|
||||
get() = config.getBool("app", "fetch_contacts_from_default_directory", true)
|
||||
|
||||
val preferNormalizedPhoneNumbersFromAddressBook: Boolean
|
||||
get() = config.getBool("app", "prefer_normalized_phone_numbers_from_address_book", true)
|
||||
|
||||
val hideStaticImageCamera: Boolean
|
||||
get() = config.getBool("app", "hide_static_image_camera", true)
|
||||
|
||||
|
|
Loading…
Reference in a new issue