From f3a18d60d965e515086915604a74721ac8a888af Mon Sep 17 00:00:00 2001 From: twyen Date: Thu, 5 Apr 2018 11:06:12 -0700 Subject: Expand Duo Interface Added status() and audioCallable() TEST=TAP Bug: 76430187 Test: TAP PiperOrigin-RevId: 191767563 Change-Id: I5852b93bd3042f3c6ed8f2155e57fdefe58edd32 --- java/com/android/dialer/duo/Duo.java | 38 ++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) (limited to 'java/com/android/dialer/duo/Duo.java') diff --git a/java/com/android/dialer/duo/Duo.java b/java/com/android/dialer/duo/Duo.java index d471a7adf..d2a5491fd 100644 --- a/java/com/android/dialer/duo/Duo.java +++ b/java/com/android/dialer/duo/Duo.java @@ -100,15 +100,49 @@ public interface Duo { /** Reachability information for a number. */ @AutoValue abstract class ReachabilityData { + public enum Status { + UNKNOWN, + + /** + * The number is callable. Apps should further look up “AUDIO_CALLABLE” and “VIDEO_CALLABLE” + * keys for supported modes. + */ + CALL, + + /** The number is not callable. Apps can send an invite to the contact via INVITE intent. */ + INVITE, + + /** + * Neither Tachystick nor Duo is registered. Apps should show “setup” icon and send REGISTER + * intent to. + */ + SETUP, + + /** + * Indicates that the number is callable but user needs to set up (Tachystick/Duo) before + * calling. + */ + SETUP_AND_CALL + } + + public abstract Status status(); + public abstract String number(); + public abstract boolean audioCallable(); + public abstract boolean videoCallable(); public abstract boolean supportsUpgrade(); public static ReachabilityData create( - String number, boolean videoCallable, boolean supportsUpgrade) { - return new AutoValue_Duo_ReachabilityData(number, videoCallable, supportsUpgrade); + Status status, + String number, + boolean audioCallable, + boolean videoCallable, + boolean supportsUpgrade) { + return new AutoValue_Duo_ReachabilityData( + status, number, audioCallable, videoCallable, supportsUpgrade); } } } -- cgit v1.2.3