From 3bf84127cd907af57524cce9db4ad02455cd0495 Mon Sep 17 00:00:00 2001 From: linyuh Date: Sun, 8 Apr 2018 23:28:26 -0700 Subject: Have PhoneLookup read carrier presence data from CP2. Bug: 70988687 Test: Cp2DefaultDirectoryPhoneLookupTest, PhoneLookupInfoConsolidatorTest PiperOrigin-RevId: 192085574 Change-Id: I4512c9e2e9e14340fa3aa9b2d7d6aaea6344bba6 --- .../consolidator/PhoneLookupInfoConsolidator.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'java/com/android/dialer/phonelookup/consolidator') 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 @@ -321,6 +321,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 -- cgit v1.2.3