summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2017-09-26 17:15:16 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2017-09-26 17:15:16 +0000
commit92fd6ef2b0f87e5afd7d59f8cd47ca985e5953f2 (patch)
tree0120aecad5243f68ace47f881f086405fd21095f
parent87801917186cab7423006fb1077ff3d70b9b22de (diff)
parentbc4263efe87601a483bdc0959df16e6de5bba902 (diff)
Merge "Fix bug that phone number is not shown for non-contacts. (CNAP, business etc.)"
-rw-r--r--java/com/android/incallui/contactgrid/TopRow.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/java/com/android/incallui/contactgrid/TopRow.java b/java/com/android/incallui/contactgrid/TopRow.java
index 12a118491..8f54266f3 100644
--- a/java/com/android/incallui/contactgrid/TopRow.java
+++ b/java/com/android/incallui/contactgrid/TopRow.java
@@ -79,7 +79,7 @@ public class TopRow {
label = getLabelForIncoming(context, state);
// Show phone number if it's not displayed in name (center row) or location field (bottom
// row).
- if (shouldShowNumber(primaryInfo)) {
+ if (shouldShowNumber(primaryInfo, true /* isIncoming */)) {
label = TextUtils.concat(label, " ", spanDisplayNumber(primaryInfo.number));
}
}
@@ -94,7 +94,8 @@ public class TopRow {
label = getLabelForDialing(context, state);
} else if (state.state == State.ACTIVE && state.isRemotelyHeld) {
label = context.getString(R.string.incall_remotely_held);
- } else if (state.state == State.ACTIVE && shouldShowNumber(primaryInfo)) {
+ } else if (state.state == State.ACTIVE
+ && shouldShowNumber(primaryInfo, false /* isIncoming */)) {
label = spanDisplayNumber(primaryInfo.number);
} else if (state.state == State.CALL_PENDING && !TextUtils.isEmpty(state.customLabel)) {
label = state.customLabel;
@@ -112,11 +113,13 @@ public class TopRow {
BidiFormatter.getInstance().unicodeWrap(displayNumber, TextDirectionHeuristics.LTR));
}
- private static boolean shouldShowNumber(PrimaryInfo primaryInfo) {
+ private static boolean shouldShowNumber(PrimaryInfo primaryInfo, boolean isIncoming) {
if (primaryInfo.nameIsNumber) {
return false;
}
- if (primaryInfo.location == null) {
+ // Don't show number since it's already shown in bottom row of incoming screen if there is no
+ // location info.
+ if (primaryInfo.location == null && isIncoming) {
return false;
}
if (TextUtils.isEmpty(primaryInfo.number)) {