diff options
author | linyuh <linyuh@google.com> | 2018-04-08 23:28:26 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-04-08 23:29:04 -0700 |
commit | 3bf84127cd907af57524cce9db4ad02455cd0495 (patch) | |
tree | 43840695a8473f80a8473f7cbdf9f82e12454cfc /java/com/android/dialer/phonelookup/consolidator | |
parent | e4200e1fb12d021482d642047e322e57039a6616 (diff) |
Have PhoneLookup read carrier presence data from CP2.
Bug: 70988687
Test: Cp2DefaultDirectoryPhoneLookupTest, PhoneLookupInfoConsolidatorTest
PiperOrigin-RevId: 192085574
Change-Id: I4512c9e2e9e14340fa3aa9b2d7d6aaea6344bba6
Diffstat (limited to 'java/com/android/dialer/phonelookup/consolidator')
-rw-r--r-- | java/com/android/dialer/phonelookup/consolidator/PhoneLookupInfoConsolidator.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/java/com/android/dialer/phonelookup/consolidator/PhoneLookupInfoConsolidator.java b/java/com/android/dialer/phonelookup/consolidator/PhoneLookupInfoConsolidator.java index 4b994e725..c3824dc49 100644 --- a/java/com/android/dialer/phonelookup/consolidator/PhoneLookupInfoConsolidator.java +++ b/java/com/android/dialer/phonelookup/consolidator/PhoneLookupInfoConsolidator.java @@ -322,6 +322,24 @@ public final class PhoneLookupInfoConsolidator { } /** + * The {@link PhoneLookupInfo} passed to the constructor is associated with a number. This method + * returns whether the number can be reached via carrier video calls. + */ + public boolean canSupportCarrierVideoCall() { + switch (nameSource) { + case NameSource.CP2_DEFAULT_DIRECTORY: + return Assert.isNotNull(firstDefaultCp2Contact).getCanSupportCarrierVideoCall(); + case NameSource.CP2_EXTENDED_DIRECTORY: + case NameSource.PEOPLE_API: + case NameSource.NONE: + return false; + default: + throw Assert.createUnsupportedOperationFailException( + String.format("Unsupported name source: %s", nameSource)); + } + } + + /** * Arbitrarily select the first CP2 contact in the default directory. In the future, it may make * sense to display contact information from all contacts with the same number (for example show * the name as "Mom, Dad" or show a synthesized photo containing photos of both "Mom" and "Dad"). |