summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/voicemail
diff options
context:
space:
mode:
authorzachh <zachh@google.com>2018-01-26 16:28:44 -0800
committerCopybara-Service <copybara-piper@google.com>2018-01-26 16:30:20 -0800
commit26f520249eccdcf2352806ba8d6a54bb8e5045a6 (patch)
treeb49fe3352268663ae05c447f0f088ccdc9df585b /java/com/android/dialer/voicemail
parent29be3926b41f09a7f8fab9845ce3d0d7bd216620 (diff)
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
Diffstat (limited to 'java/com/android/dialer/voicemail')
-rw-r--r--java/com/android/dialer/voicemail/listui/NewVoicemailMediaPlayerView.java2
-rw-r--r--java/com/android/dialer/voicemail/listui/menu/Modules.java6
2 files changed, 4 insertions, 4 deletions
diff --git a/java/com/android/dialer/voicemail/listui/NewVoicemailMediaPlayerView.java b/java/com/android/dialer/voicemail/listui/NewVoicemailMediaPlayerView.java
index dd59712a4..df4715974 100644
--- a/java/com/android/dialer/voicemail/listui/NewVoicemailMediaPlayerView.java
+++ b/java/com/android/dialer/voicemail/listui/NewVoicemailMediaPlayerView.java
@@ -151,7 +151,7 @@ public final class NewVoicemailMediaPlayerView extends LinearLayout {
Assert.isNotNull(voicemailEntryFromAdapter);
Uri uri = Uri.parse(voicemailEntryFromAdapter.voicemailUri());
- numberVoicemailFrom = voicemailEntryFromAdapter.number().getRawInput().getNumber();
+ numberVoicemailFrom = voicemailEntryFromAdapter.number().getNormalizedNumber();
Assert.isNotNull(viewHolder);
Assert.isNotNull(uri);
diff --git a/java/com/android/dialer/voicemail/listui/menu/Modules.java b/java/com/android/dialer/voicemail/listui/menu/Modules.java
index bd79932e7..665031a1f 100644
--- a/java/com/android/dialer/voicemail/listui/menu/Modules.java
+++ b/java/com/android/dialer/voicemail/listui/menu/Modules.java
@@ -43,8 +43,8 @@ final class Modules {
voicemailEntry.numberAttributes().getName(),
voicemailEntry.numberAttributes().getLookupUri());
- String originalNumber = voicemailEntry.number().getRawInput().getNumber();
- SharedModules.maybeAddModuleForSendingTextMessage(context, modules, originalNumber);
+ String normalizedNumber = voicemailEntry.number().getNormalizedNumber();
+ SharedModules.maybeAddModuleForSendingTextMessage(context, modules, normalizedNumber);
if (!modules.isEmpty()) {
modules.add(new DividerModule());
@@ -52,7 +52,7 @@ final class Modules {
// TODO(zachh): Module for blocking/unblocking spam.
// TODO(zachh): Module for CallComposer.
- SharedModules.maybeAddModuleForCopyingNumber(context, modules, originalNumber);
+ SharedModules.maybeAddModuleForCopyingNumber(context, modules, normalizedNumber);
return modules;
}