summaryrefslogtreecommitdiff
path: root/telecomm/java/android/telecom/ConnectionRequest.java
diff options
context:
space:
mode:
authorTyler Gunn <tgunn@google.com>2017-01-09 09:43:12 -0800
committerTyler Gunn <tgunn@google.com>2017-01-18 14:44:43 -0800
commitf50354363c2bace924c6aeea5746b3c690a7108e (patch)
tree9607b02cce72b285e98752fcb67f1223ac461681 /telecomm/java/android/telecom/ConnectionRequest.java
parentcf3a4a68bddd5dbca05595a29e0ba3b13d809cb4 (diff)
Adding self-managed connection service APIs.
1. Adding new APIs for self-managed connection services. 2. Adding Telecom package-level documentation. Test: Manual (unit, cts pending; this is just scaffolding for now) Bug: 34159263 Change-Id: Ic226ec8bfcb2fbcc02fe802b47499e47aab17d0a
Diffstat (limited to 'telecomm/java/android/telecom/ConnectionRequest.java')
-rw-r--r--telecomm/java/android/telecom/ConnectionRequest.java27
1 files changed, 24 insertions, 3 deletions
diff --git a/telecomm/java/android/telecom/ConnectionRequest.java b/telecomm/java/android/telecom/ConnectionRequest.java
index aba38fe8a376..23434624bf87 100644
--- a/telecomm/java/android/telecom/ConnectionRequest.java
+++ b/telecomm/java/android/telecom/ConnectionRequest.java
@@ -33,6 +33,7 @@ public final class ConnectionRequest implements Parcelable {
private final Bundle mExtras;
private final int mVideoState;
private final String mTelecomCallId;
+ private final boolean mShouldShowIncomingCallUi;
/**
* @param accountHandle The accountHandle which should be used to place the call.
@@ -43,7 +44,7 @@ public final class ConnectionRequest implements Parcelable {
PhoneAccountHandle accountHandle,
Uri handle,
Bundle extras) {
- this(accountHandle, handle, extras, VideoProfile.STATE_AUDIO_ONLY, null);
+ this(accountHandle, handle, extras, VideoProfile.STATE_AUDIO_ONLY, null, false);
}
/**
@@ -57,7 +58,7 @@ public final class ConnectionRequest implements Parcelable {
Uri handle,
Bundle extras,
int videoState) {
- this(accountHandle, handle, extras, videoState, null);
+ this(accountHandle, handle, extras, videoState, null, false);
}
/**
@@ -66,6 +67,10 @@ public final class ConnectionRequest implements Parcelable {
* @param extras Application-specific extra data.
* @param videoState Determines the video state for the connection.
* @param telecomCallId The telecom call ID.
+ * @param shouldShowIncomingCallUi For a self-managed {@link ConnectionService}, will be
+ * {@code true} if the {@link ConnectionService} should show its
+ * own incoming call UI for an incoming call. When
+ * {@code false}, Telecom shows the incoming call UI.
* @hide
*/
public ConnectionRequest(
@@ -73,12 +78,14 @@ public final class ConnectionRequest implements Parcelable {
Uri handle,
Bundle extras,
int videoState,
- String telecomCallId) {
+ String telecomCallId,
+ boolean shouldShowIncomingCallUi) {
mAccountHandle = accountHandle;
mAddress = handle;
mExtras = extras;
mVideoState = videoState;
mTelecomCallId = telecomCallId;
+ mShouldShowIncomingCallUi = shouldShowIncomingCallUi;
}
private ConnectionRequest(Parcel in) {
@@ -87,6 +94,7 @@ public final class ConnectionRequest implements Parcelable {
mExtras = in.readParcelable(getClass().getClassLoader());
mVideoState = in.readInt();
mTelecomCallId = in.readString();
+ mShouldShowIncomingCallUi = in.readInt() == 1;
}
/**
@@ -129,6 +137,18 @@ public final class ConnectionRequest implements Parcelable {
return mTelecomCallId;
}
+ /**
+ * For a self-managed {@link ConnectionService}, indicates for an incoming call whether the
+ * {@link ConnectionService} should show its own incoming call UI for an incoming call.
+ *
+ * @return {@code true} if the {@link ConnectionService} should show its own incoming call UI.
+ * When {@code false}, Telecom shows the incoming call UI for the call.
+ * @hide
+ */
+ public boolean shouldShowIncomingCallUi() {
+ return mShouldShowIncomingCallUi;
+ }
+
@Override
public String toString() {
return String.format("ConnectionRequest %s %s",
@@ -165,5 +185,6 @@ public final class ConnectionRequest implements Parcelable {
destination.writeParcelable(mExtras, 0);
destination.writeInt(mVideoState);
destination.writeString(mTelecomCallId);
+ destination.writeInt(mShouldShowIncomingCallUi ? 1 : 0);
}
}