summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
Diffstat (limited to 'java')
-rw-r--r--java/com/android/dialer/app/calllog/PhoneCallDetailsHelper.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/java/com/android/dialer/app/calllog/PhoneCallDetailsHelper.java b/java/com/android/dialer/app/calllog/PhoneCallDetailsHelper.java
index 2632fb380..9d04cb2c8 100644
--- a/java/com/android/dialer/app/calllog/PhoneCallDetailsHelper.java
+++ b/java/com/android/dialer/app/calllog/PhoneCallDetailsHelper.java
@@ -48,6 +48,8 @@ import com.android.dialer.compat.android.provider.VoicemailCompat;
import com.android.dialer.compat.telephony.TelephonyManagerCompat;
import com.android.dialer.logging.ContactSource;
import com.android.dialer.oem.MotorolaUtils;
+import com.android.dialer.phonenumbercache.CachedNumberLookupService;
+import com.android.dialer.phonenumbercache.PhoneNumberCache;
import com.android.dialer.phonenumberutil.PhoneNumberHelper;
import com.android.dialer.spannable.ContentWithLearnMoreSpanner;
import com.android.dialer.storage.StorageComponent;
@@ -76,6 +78,8 @@ public class PhoneCallDetailsHelper
private final CallLogCache callLogCache;
/** Calendar used to construct dates */
private final Calendar calendar;
+
+ private final CachedNumberLookupService cachedNumberLookupService;
/** The injected current time in milliseconds since the epoch. Used only by tests. */
private Long currentTimeMillisForTest;
@@ -95,6 +99,7 @@ public class PhoneCallDetailsHelper
this.resources = resources;
this.callLogCache = callLogCache;
calendar = Calendar.getInstance();
+ cachedNumberLookupService = PhoneNumberCache.get(context).getCachedNumberLookupService();
}
static boolean shouldShowVoicemailDonationPromo(
@@ -125,7 +130,7 @@ public class PhoneCallDetailsHelper
}
/** Returns true if primary name is empty or the data is from Cequint Caller ID. */
- private static boolean shouldShowLocation(PhoneCallDetails details) {
+ private boolean shouldShowLocation(PhoneCallDetails details) {
if (TextUtils.isEmpty(details.geocode)) {
return false;
}
@@ -133,6 +138,11 @@ public class PhoneCallDetailsHelper
if (details.sourceType == ContactSource.Type.SOURCE_TYPE_CEQUINT_CALLER_ID) {
return true;
}
+ if (cachedNumberLookupService != null
+ && cachedNumberLookupService.isBusiness(details.sourceType)) {
+ return true;
+ }
+
// Don't bother showing geo location for contacts.
if (!TextUtils.isEmpty(details.namePrimary)) {
return false;
@@ -482,7 +492,6 @@ public class PhoneCallDetailsHelper
: Phone.getTypeLabel(resources, details.numberType, details.numberLabel);
}
}
-
if (!TextUtils.isEmpty(details.namePrimary) && TextUtils.isEmpty(numberFormattedLabel)) {
numberFormattedLabel = details.displayNumber;
}