diff options
author | twyen <twyen@google.com> | 2017-12-14 17:20:12 -0800 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2017-12-14 17:42:57 -0800 |
commit | 937bd02d7cb045cea9aa21a76f3425a68468eeeb (patch) | |
tree | 214f38d755e7f7fde9a85997af3e886d718c87f2 /java/com/android/dialer/phonelookup | |
parent | 77217824a09b4c93d0103c57acfa13368a7b8807 (diff) |
Implement PeopleApiPhoneLookup
This CL rewrites com.google.android.dialer.reverselookup and uses gRPC instead to perform People API queries.
Bug: 70355819
Test: PeopleApiPhoneLookupTest, PeopleApiPHoneLookupInfoTransformerTest
PiperOrigin-RevId: 179122466
Change-Id: I769c8b420b9d71b9787d844380b2aceb7ff2c63c
Diffstat (limited to 'java/com/android/dialer/phonelookup')
-rw-r--r-- | java/com/android/dialer/phonelookup/PhoneLookupSelector.java | 3 | ||||
-rw-r--r-- | java/com/android/dialer/phonelookup/phone_lookup_info.proto | 32 |
2 files changed, 35 insertions, 0 deletions
diff --git a/java/com/android/dialer/phonelookup/PhoneLookupSelector.java b/java/com/android/dialer/phonelookup/PhoneLookupSelector.java index af8b849e5..0fe989332 100644 --- a/java/com/android/dialer/phonelookup/PhoneLookupSelector.java +++ b/java/com/android/dialer/phonelookup/PhoneLookupSelector.java @@ -46,6 +46,9 @@ public final class PhoneLookupSelector { return firstLocalContact.getName(); } } + if (phoneLookupInfo.hasPeopleApiInfo()) { + return phoneLookupInfo.getPeopleApiInfo().getDisplayName(); + } return ""; } diff --git a/java/com/android/dialer/phonelookup/phone_lookup_info.proto b/java/com/android/dialer/phonelookup/phone_lookup_info.proto index 36596c1a2..4e62d67c1 100644 --- a/java/com/android/dialer/phonelookup/phone_lookup_info.proto +++ b/java/com/android/dialer/phonelookup/phone_lookup_info.proto @@ -50,4 +50,36 @@ message PhoneLookupInfo { optional bool is_spam = 1; } optional ApdlInfo apdl_info = 2; + + // Message for PeopleApi, including G+ contacts and nearby places + message PeopleApiInfo { + // Best display name determined by people API if available, first display + // name otherwise. + optional string display_name = 1; + + // The type of the number, for example "phone" or "home". + optional string number_type = 2; + + // The number_type label in human readable string, for example "Phone". + // The UI should display known number_type with string resources if possible + // but if number_type is unrecognized formatted_number_type. For example + // if the user set an custom type label. + optional string formatted_number_type = 3; + + // URL to the contact's full size photo. + optional string image_url = 4; + + // The primary key of the contact in people API. + optional string person_id = 5; + + enum InfoType { + UNKNOWN = 0; + CONTACT = 1; // the result is a saved contact in people API + NEARBY_BUSINESS = 2; // the result is found through nearby places + } + // The type of the lookup result, for example, a saved contact or a nearby + // business. + optional InfoType info_type = 6; + } + optional PeopleApiInfo people_api_info = 3; }
\ No newline at end of file |