summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwangqi <wangqi@google.com>2017-09-26 17:20:28 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-09-26 17:20:28 +0000
commit91445e1a4a71a3545fc393a1c7034ffddbc6ce62 (patch)
treee49a400240a40685999edd33ce8ff0c1f5e57c03
parentaa39ee0dba3db59db4f880e20a6ff2a97b4385b6 (diff)
parent92fd6ef2b0f87e5afd7d59f8cd47ca985e5953f2 (diff)
Merge "Fix bug that phone number is not shown for non-contacts. (CNAP, business etc.)"
am: 92fd6ef2b0 Change-Id: I2ac6c4c1b6f3d09973164e2ecfb1bfa8caf23ff1
-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)) {