summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/duo/Duo.java
diff options
context:
space:
mode:
authortwyen <twyen@google.com>2018-05-01 14:53:14 -0700
committerWeijia Xu <weijiaxu@google.com>2018-05-04 06:14:46 +0000
commit34b1662b7532343341bbee22227e8ed82575864f (patch)
treeb58aa9f0742adf3808b07c9e195336552f1ca64c /java/com/android/dialer/duo/Duo.java
parent27faa86cb0488d6c77dc5ff9946e58ae9ca40485 (diff)
Replace DuoConstants with interface.
They are not constant across different Duo implementations. TEST=TAP Bug: 76430187,78783816 Test: TAP PiperOrigin-RevId: 195001650 Change-Id: I4356d04c9eeac50fefd41e1142f3123591e93bc0
Diffstat (limited to 'java/com/android/dialer/duo/Duo.java')
-rw-r--r--java/com/android/dialer/duo/Duo.java36
1 files changed, 35 insertions, 1 deletions
diff --git a/java/com/android/dialer/duo/Duo.java b/java/com/android/dialer/duo/Duo.java
index e020c80e6..06a3db063 100644
--- a/java/com/android/dialer/duo/Duo.java
+++ b/java/com/android/dialer/duo/Duo.java
@@ -30,6 +30,7 @@ import com.google.common.base.Optional;
import java.util.List;
/** Interface for Duo video call integration. */
+@SuppressWarnings("Guava")
public interface Duo {
/** @return true if the Duo integration is enabled on this device. */
@@ -70,11 +71,44 @@ public interface Duo {
void reloadReachability(@NonNull Context context);
/**
+ * Get the {@link PhoneAccountHandle} used by duo calls in the connection service and call log.
+ */
+ Optional<PhoneAccountHandle> getPhoneAccountHandle();
+
+ boolean isDuoAccount(PhoneAccountHandle phoneAccountHandle);
+
+ boolean isDuoAccount(String componentName);
+
+ /**
* @return an Intent to start a Duo video call with the parameter number. Must be started using
* startActivityForResult.
*/
@MainThread
- Intent getIntent(@NonNull Context context, @NonNull String number);
+ Optional<Intent> getCallIntent(@NonNull String number);
+
+ /** @return an Intent to setup duo. Must be started using startActivityForResult. */
+ Optional<Intent> getActivateIntent();
+
+ /**
+ * @return an Intent to invite the parameter number to use duo. Must be started using
+ * startActivityForResult.
+ */
+ Optional<Intent> getInviteIntent(String number);
+
+ /** Return value of {@link #getIntentType(Intent)} */
+ enum IntentType {
+ /** The intent is returned by {@link #getCallIntent(String)} */
+ CALL,
+ /** The intent is returned by {@link #getActivateIntent()} */
+ ACTIVATE,
+ /** The intent is returned by {@link #getInviteIntent(String)} */
+ INVITE
+ }
+
+ /** Classifies a Duo intent. Absent if the intent is not a Duo intent. */
+ Optional<IntentType> getIntentType(Intent intent);
+
+ Optional<Intent> getInstallDuoIntent();
/** Requests upgrading the parameter ongoing call to a Duo video call. */
@MainThread