summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Lee <anwlee@google.com>2015-06-03 18:03:27 -0700
committerAndrew Lee <anwlee@google.com>2015-06-03 18:25:35 -0700
commitbdf60d080ccab765e659b0e27b1fdb7122f5d008 (patch)
tree9839a9ed5fb283e2808bf82200bfcdd861781f61 /src
parentf42d5ee4d6581d2cb746e615dbb3c94375f8990c (diff)
Fix unit test errors.
When this was refactored before, some of the logic was bad. Some of the expected values were changed as well. I figured "add to contacts" is a really bad default text, because we don't actually support that action in call details. Also, the strings returned by the library for describing relative time spans changed. Bug: 21471763 Change-Id: I0c78c89c9c2e44de198f1f9299711fc31fe81cb1
Diffstat (limited to 'src')
-rw-r--r--src/com/android/dialer/PhoneCallDetailsHelper.java8
-rw-r--r--src/com/android/dialer/calllog/PhoneNumberDisplayUtil.java8
2 files changed, 9 insertions, 7 deletions
diff --git a/src/com/android/dialer/PhoneCallDetailsHelper.java b/src/com/android/dialer/PhoneCallDetailsHelper.java
index db37bb3f3..c8206227a 100644
--- a/src/com/android/dialer/PhoneCallDetailsHelper.java
+++ b/src/com/android/dialer/PhoneCallDetailsHelper.java
@@ -212,10 +212,12 @@ public class PhoneCallDetailsHelper {
@NeededForTesting
public void setCallDetailsHeader(TextView nameView, PhoneCallDetails details) {
final CharSequence nameText;
- if (TextUtils.isEmpty(details.name)) {
- nameText = mResources.getString(R.string.recentCalls_addToContact);
- } else {
+ if (!TextUtils.isEmpty(details.name)) {
nameText = details.name;
+ } else if (!TextUtils.isEmpty(details.displayNumber)) {
+ nameText = details.displayNumber;
+ } else {
+ nameText = mResources.getString(R.string.unknown);
}
nameView.setText(nameText);
diff --git a/src/com/android/dialer/calllog/PhoneNumberDisplayUtil.java b/src/com/android/dialer/calllog/PhoneNumberDisplayUtil.java
index e7fcde263..acfd32cf3 100644
--- a/src/com/android/dialer/calllog/PhoneNumberDisplayUtil.java
+++ b/src/com/android/dialer/calllog/PhoneNumberDisplayUtil.java
@@ -71,14 +71,14 @@ public class PhoneNumberDisplayUtil {
int presentation,
CharSequence formattedNumber,
boolean isVoicemail) {
- if (!TextUtils.isEmpty(formattedNumber)) {
- return formattedNumber;
- }
-
final CharSequence displayName =
getDisplayName(context, accountHandle, number, presentation, isVoicemail);
if (!TextUtils.isEmpty(displayName)) {
return displayName;
+ }
+
+ if (!TextUtils.isEmpty(formattedNumber)) {
+ return formattedNumber;
} else if (!TextUtils.isEmpty(number)) {
return number;
} else {