Set structured name when creating contacts.

Fixes #12305. When creating copies of contacts, set the structured name
fields instead of the unstructured name fields. This fixes bugs where
certain types of names are displayed incorrectly because the structured
name is inaccurately reconstructed from the unstructured name.

Closes #13366
This commit is contained in:
Pratyush Venkatakrishnan
2024-01-16 14:47:29 -05:00
committed by Greyson Parrelli
parent c54313c32e
commit cf89c988cf
2 changed files with 40 additions and 9 deletions

View File

@@ -37,7 +37,7 @@ class ContactListViewModel(application: Application) : AndroidViewModel(applicat
val contactList: List<ContactDetails> = SystemContactsRepository.getAllSystemContacts(
context = application,
e164Formatter = { number -> PhoneNumberUtils.formatNumberToE164(number, "US") ?: number }
).use { it.toList() }
).use { it.toList().sortedBy { c -> c.givenName } }
_contacts.postValue(contactList)
} else {