summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortwyen <twyen@google.com>2018-04-05 11:06:12 -0700
committerCopybara-Service <copybara-piper@google.com>2018-04-05 11:58:33 -0700
commitf3a18d60d965e515086915604a74721ac8a888af (patch)
treea2275edf2eb136aefb6f0ee8dd201e0266300711
parent13ce35c55fc3f4f44fced5183b29081d21e14a96 (diff)
Expand Duo Interface
Added status() and audioCallable() TEST=TAP Bug: 76430187 Test: TAP PiperOrigin-RevId: 191767563 Change-Id: I5852b93bd3042f3c6ed8f2155e57fdefe58edd32
-rw-r--r--java/com/android/dialer/duo/Duo.java38
1 files changed, 36 insertions, 2 deletions
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);
}
}
}