summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorzachh <zachh@google.com>2018-05-07 13:44:12 -0700
committerCopybara-Service <copybara-piper@google.com>2018-05-09 16:52:50 -0700
commitfe5a0d3ea79dca9b0e7184dc7ec49ed9e874386c (patch)
tree73b9e55b7046733f730ddfecf61056115ed43ca4 /java
parent3b905e417acd9c5b3f0649cf03e9289a2dee8a04 (diff)
Set the DisplayNameSource to PHONE in DefaultLookupUriGenerator.
In this case we don't have a name, but set the DISPLAY_NAME to the number to make the contact card look nice. However, when using STRUCTURED_NAME and creating a new contact with the number, the number is populated in both the first/last name fields and the number field. Using PHONE makes it so the number is displayed on the contact card but the number is not populated in the name fields when creating a contact. This is consistent with the old call log's behavior (see ContactInfoHelper:createTemporaryContactUri). TEST=manual Bug: 78252466 Test: manual PiperOrigin-RevId: 195714742 Change-Id: I26cf18a76af60f48d7979cd8cc8e47d72de1bf5e
Diffstat (limited to 'java')
-rw-r--r--java/com/android/dialer/glidephotomanager/impl/DefaultLookupUriGenerator.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/java/com/android/dialer/glidephotomanager/impl/DefaultLookupUriGenerator.java b/java/com/android/dialer/glidephotomanager/impl/DefaultLookupUriGenerator.java
index 6b90e803c..2c4acd4df 100644
--- a/java/com/android/dialer/glidephotomanager/impl/DefaultLookupUriGenerator.java
+++ b/java/com/android/dialer/glidephotomanager/impl/DefaultLookupUriGenerator.java
@@ -48,7 +48,7 @@ final class DefaultLookupUriGenerator {
try {
lookupJson.put(Contacts.DISPLAY_NAME, photoInfo.getFormattedNumber());
// DISPLAY_NAME_SOURCE required by contacts, otherwise the URI will not be recognized.
- lookupJson.put(Contacts.DISPLAY_NAME_SOURCE, DisplayNameSources.STRUCTURED_NAME);
+ lookupJson.put(Contacts.DISPLAY_NAME_SOURCE, DisplayNameSources.PHONE);
JSONObject contactRows = new JSONObject();
JSONObject phone = new JSONObject();
phone.put(CommonDataKinds.Phone.NUMBER, photoInfo.getFormattedNumber());