From fe5a0d3ea79dca9b0e7184dc7ec49ed9e874386c Mon Sep 17 00:00:00 2001 From: zachh Date: Mon, 7 May 2018 13:44:12 -0700 Subject: 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 --- .../dialer/glidephotomanager/impl/DefaultLookupUriGenerator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'java/com/android/dialer/glidephotomanager') 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()); -- cgit v1.2.3