Display "unknown" in the name field for voicemail with unknown callers.
For calls, we will never display an empty name field because we have the
"name presentation" from the call that will inform the UI how to display
the name (whether "restricted", "unknown", etc.). However for
voicemails, there is no such similar field because the voicemail is not
associated with a particular call. In the case where the name field in
the voicemail table is blank (which would be the case if the server failed to
provide it or the caller obscured their phone number), instead of
displaying an empty string, this CL defaults the name to "unknown".
Bug: 25020236
Change-Id: I7355abb88ac4ac90f7b19c86f335964aaad336aa
diff --git a/src/com/android/dialer/calllog/PhoneNumberDisplayUtil.java b/src/com/android/dialer/calllog/PhoneNumberDisplayUtil.java
index 91cd3e1..09b42e9 100644
--- a/src/com/android/dialer/calllog/PhoneNumberDisplayUtil.java
+++ b/src/com/android/dialer/calllog/PhoneNumberDisplayUtil.java
@@ -78,7 +78,7 @@
} else if (!TextUtils.isEmpty(number)) {
return number.toString() + postDialDigits;
} else {
- return "";
+ return context.getResources().getString(R.string.unknown);
}
}