From 188b42fd10644373175fc204b48da98125004985 Mon Sep 17 00:00:00 2001 From: twyen Date: Thu, 11 Jan 2018 16:03:11 -0800 Subject: Merge PhoneLookupDataSource results into a proto in annotated call log. This allow extra information from PhoneLookup to be more easily added. Only PhoneLookupSelector and the proto will be affected for new attributes. Test: Unit tests. PiperOrigin-RevId: 181675568 Change-Id: I4e0bc1c6005b58a9b684b030b55bea6223af9ce3 --- .../dialer/phonelookup/selector/PhoneLookupSelector.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'java/com/android/dialer/phonelookup') diff --git a/java/com/android/dialer/phonelookup/selector/PhoneLookupSelector.java b/java/com/android/dialer/phonelookup/selector/PhoneLookupSelector.java index 6b217e951..8d082911c 100644 --- a/java/com/android/dialer/phonelookup/selector/PhoneLookupSelector.java +++ b/java/com/android/dialer/phonelookup/selector/PhoneLookupSelector.java @@ -127,6 +127,20 @@ public final class PhoneLookupSelector { return ""; } + public boolean selectIsBusiness(PhoneLookupInfo phoneLookupInfo) { + return phoneLookupInfo.hasPeopleApiInfo() + && phoneLookupInfo.getPeopleApiInfo().getInfoType() == InfoType.NEARBY_BUSINESS; + } + + public boolean selectIsVoicemail(PhoneLookupInfo unused) { + // TODO(twyen): implement + return false; + } + + public boolean selectIsCp2InfoIncomplete(PhoneLookupInfo phoneLookupInfo) { + return phoneLookupInfo.getCp2LocalInfo().getIsIncomplete(); + } + /** * Returns true if the number associated with the given {@link PhoneLookupInfo} can be reported as * invalid. @@ -134,7 +148,7 @@ public final class PhoneLookupSelector { *

As we currently report invalid numbers via the People API, only numbers from the People API * can be reported as invalid. */ - public static boolean canReportAsInvalidNumber(PhoneLookupInfo phoneLookupInfo) { + public boolean canReportAsInvalidNumber(PhoneLookupInfo phoneLookupInfo) { // The presence of Cp2ContactInfo means the number associated with the given PhoneLookupInfo // matches that of a Cp2 (local) contact, and PeopleApiInfo will not be used to display // information like name, photo, etc. We should not allow the user to report the number in this -- cgit v1.2.3