From 26f520249eccdcf2352806ba8d6a54bb8e5045a6 Mon Sep 17 00:00:00 2001 From: zachh Date: Fri, 26 Jan 2018 16:28:44 -0800 Subject: Reworked the internals of DialerPhoneNumber. It turns out the storing the libphonenumber representation of the number is not particularly useful because even formatting these objects cannot be done on the main thread. Rather than propagate the requirement of using PhoneNumberUtil (and background threads by extension) in the call log UI, we now just store a dialer-normalized version of the number which contains all information required by the UI in a way that allows us to avoid any background work in the UI code. Bug: 72563861 Test: existing PiperOrigin-RevId: 183463907 Change-Id: I4bdadaccb7a84033b3c72c54fe3833064f587ee3 --- java/com/android/dialer/contactactions/SharedModules.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'java/com/android/dialer/contactactions') diff --git a/java/com/android/dialer/contactactions/SharedModules.java b/java/com/android/dialer/contactactions/SharedModules.java index 6c6f6b238..7e72863aa 100644 --- a/java/com/android/dialer/contactactions/SharedModules.java +++ b/java/com/android/dialer/contactactions/SharedModules.java @@ -48,14 +48,14 @@ public class SharedModules { } // Skip showing the menu item if there is no number. - String originalNumber = number.getRawInput().getNumber(); - if (TextUtils.isEmpty(originalNumber)) { + String normalizedNumber = number.getNormalizedNumber(); + if (TextUtils.isEmpty(normalizedNumber)) { return; } Intent intent = new Intent(Intent.ACTION_INSERT_OR_EDIT); intent.setType(ContactsContract.Contacts.CONTENT_ITEM_TYPE); - intent.putExtra(ContactsContract.Intents.Insert.PHONE, originalNumber); + intent.putExtra(ContactsContract.Intents.Insert.PHONE, normalizedNumber); if (!TextUtils.isEmpty(name)) { intent.putExtra(ContactsContract.Intents.Insert.NAME, name); -- cgit v1.2.3