diff options
author | twyen <twyen@google.com> | 2018-01-11 16:03:11 -0800 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-01-11 17:02:52 -0800 |
commit | 188b42fd10644373175fc204b48da98125004985 (patch) | |
tree | 9f7434fe8cb3bbf3cffc513225288e9946851745 /java/com/android/dialer/phonelookup | |
parent | 98280255db8824cb58caac596cb4f9febcf57306 (diff) |
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
Diffstat (limited to 'java/com/android/dialer/phonelookup')
-rw-r--r-- | java/com/android/dialer/phonelookup/selector/PhoneLookupSelector.java | 16 |
1 files changed, 15 insertions, 1 deletions
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 { * <p>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 |