summaryrefslogtreecommitdiffstats
path: root/telecomm/java/android/telecom/RemoteConnection.java
diff options
context:
space:
mode:
Diffstat (limited to 'telecomm/java/android/telecom/RemoteConnection.java')
-rw-r--r--telecomm/java/android/telecom/RemoteConnection.java117
1 files changed, 94 insertions, 23 deletions
diff --git a/telecomm/java/android/telecom/RemoteConnection.java b/telecomm/java/android/telecom/RemoteConnection.java
index 4a89692..486691f 100644
--- a/telecomm/java/android/telecom/RemoteConnection.java
+++ b/telecomm/java/android/telecom/RemoteConnection.java
@@ -73,14 +73,21 @@ public final class RemoteConnection {
*/
public void onRingbackRequested(RemoteConnection connection, boolean ringback) {}
+ /** @hide */
+ @Deprecated public void onCallCapabilitiesChanged(
+ RemoteConnection connection,
+ int callCapabilities) {}
+
/**
* Indicates that the call capabilities of this {@code RemoteConnection} have changed.
- * See {@link #getCallCapabilities()}.
+ * See {@link #getConnectionCapabilities()}.
*
* @param connection The {@code RemoteConnection} invoking this method.
- * @param callCapabilities The new call capabilities of the {@code RemoteConnection}.
+ * @param connectionCapabilities The new capabilities of the {@code RemoteConnection}.
*/
- public void onCallCapabilitiesChanged(RemoteConnection connection, int callCapabilities) {}
+ public void onConnectionCapabilitiesChanged(
+ RemoteConnection connection,
+ int connectionCapabilities) {}
/**
* Invoked when the post-dial sequence in the outgoing {@code Connection} has reached a
@@ -94,6 +101,15 @@ public final class RemoteConnection {
public void onPostDialWait(RemoteConnection connection, String remainingPostDialSequence) {}
/**
+ * Invoked when the post-dial sequence in the outgoing {@code Connection} has processed
+ * a character.
+ *
+ * @param connection The {@code RemoteConnection} invoking this method.
+ * @param nextChar The character being processed.
+ */
+ public void onPostDialChar(RemoteConnection connection, char nextChar) {}
+
+ /**
* Indicates that the VOIP audio status of this {@code RemoteConnection} has changed.
* See {@link #isVoipAudioMode()}.
*
@@ -385,7 +401,7 @@ public final class RemoteConnection {
private DisconnectCause mDisconnectCause;
private boolean mRingbackRequested;
private boolean mConnected;
- private int mCallCapabilities;
+ private int mConnectionCapabilities;
private int mVideoState;
private VideoProvider mVideoProvider;
private boolean mIsVoipAudioMode;
@@ -410,6 +426,29 @@ public final class RemoteConnection {
}
/**
+ * @hide
+ */
+ RemoteConnection(String callId, IConnectionService connectionService,
+ ParcelableConnection connection) {
+ mConnectionId = callId;
+ mConnectionService = connectionService;
+ mConnected = true;
+ mState = connection.getState();
+ mDisconnectCause = connection.getDisconnectCause();
+ mRingbackRequested = connection.isRingbackRequested();
+ mConnectionCapabilities = connection.getConnectionCapabilities();
+ mVideoState = connection.getVideoState();
+ mVideoProvider = new RemoteConnection.VideoProvider(connection.getVideoProvider());
+ mIsVoipAudioMode = connection.getIsVoipAudioMode();
+ mStatusHints = connection.getStatusHints();
+ mAddress = connection.getHandle();
+ mAddressPresentation = connection.getHandlePresentation();
+ mCallerDisplayName = connection.getCallerDisplayName();
+ mCallerDisplayNamePresentation = connection.getCallerDisplayNamePresentation();
+ mConference = null;
+ }
+
+ /**
* Create a RemoteConnection which is used for failed connections. Note that using it for any
* "real" purpose will almost certainly fail. Callers should note the failure and act
* accordingly (moving on to another RemoteConnection, for example)
@@ -418,7 +457,7 @@ public final class RemoteConnection {
* @hide
*/
RemoteConnection(DisconnectCause disconnectCause) {
- this("NULL", null, null);
+ mConnectionId = "NULL";
mConnected = false;
mState = Connection.STATE_DISCONNECTED;
mDisconnectCause = disconnectCause;
@@ -454,23 +493,29 @@ public final class RemoteConnection {
}
/**
+ * Obtains the reason why this {@code RemoteConnection} may have been disconnected.
+ *
* @return For a {@link Connection#STATE_DISCONNECTED} {@code RemoteConnection}, the
- * disconnect cause expressed as a code chosen from among those declared in
- * {@link DisconnectCause}.
+ * disconnect cause expressed as a code chosen from among those declared in
+ * {@link DisconnectCause}.
*/
public DisconnectCause getDisconnectCause() {
return mDisconnectCause;
}
/**
+ * Obtains the capabilities of this {@code RemoteConnection}.
+ *
* @return A bitmask of the capabilities of the {@code RemoteConnection}, as defined in
- * {@link PhoneCapabilities}.
+ * the {@code CAPABILITY_*} constants in class {@link Connection}.
*/
- public int getCallCapabilities() {
- return mCallCapabilities;
+ public int getConnectionCapabilities() {
+ return mConnectionCapabilities;
}
/**
+ * Determines if the audio mode of this {@code RemoteConnection} is VOIP.
+ *
* @return {@code true} if the {@code RemoteConnection}'s current audio mode is VOIP.
*/
public boolean isVoipAudioMode() {
@@ -478,30 +523,38 @@ public final class RemoteConnection {
}
/**
+ * Obtains status hints pertaining to this {@code RemoteConnection}.
+ *
* @return The current {@link StatusHints} of this {@code RemoteConnection},
- * or {@code null} if none have been set.
+ * or {@code null} if none have been set.
*/
public StatusHints getStatusHints() {
return mStatusHints;
}
/**
- * @return The address (e.g., phone number) to which the {@code RemoteConnection} is currently
- * connected.
+ * Obtains the address of this {@code RemoteConnection}.
+ *
+ * @return The address (e.g., phone number) to which the {@code RemoteConnection}
+ * is currently connected.
*/
public Uri getAddress() {
return mAddress;
}
/**
- * @return The presentation requirements for the address. See {@link TelecomManager} for valid
- * values.
+ * Obtains the presentation requirements for the address of this {@code RemoteConnection}.
+ *
+ * @return The presentation requirements for the address. See
+ * {@link TelecomManager} for valid values.
*/
public int getAddressPresentation() {
return mAddressPresentation;
}
/**
+ * Obtains the display name for this {@code RemoteConnection}'s caller.
+ *
* @return The display name for the caller.
*/
public CharSequence getCallerDisplayName() {
@@ -509,16 +562,20 @@ public final class RemoteConnection {
}
/**
+ * Obtains the presentation requirements for this {@code RemoteConnection}'s
+ * caller's display name.
+ *
* @return The presentation requirements for the caller display name. See
- * {@link TelecomManager} for valid values.
+ * {@link TelecomManager} for valid values.
*/
public int getCallerDisplayNamePresentation() {
return mCallerDisplayNamePresentation;
}
/**
- * @return The video state of the {@code RemoteConnection}. See
- * {@link VideoProfile.VideoState}.
+ * Obtains the video state of this {@code RemoteConnection}.
+ *
+ * @return The video state of the {@code RemoteConnection}. See {@link VideoProfile.VideoState}.
* @hide
*/
public int getVideoState() {
@@ -526,6 +583,8 @@ public final class RemoteConnection {
}
/**
+ * Obtains the video provider of this {@code RemoteConnection}.
+ *
* @return The video provider associated with this {@code RemoteConnection}.
* @hide
*/
@@ -534,8 +593,10 @@ public final class RemoteConnection {
}
/**
+ * Determines whether this {@code RemoteConnection} is requesting ringback.
+ *
* @return Whether the {@code RemoteConnection} is requesting that the framework play a
- * ringback tone on its behalf.
+ * ringback tone on its behalf.
*/
public boolean isRingbackRequested() {
return false;
@@ -674,7 +735,7 @@ public final class RemoteConnection {
* of time.
*
* If the DTMF string contains a {@link TelecomManager#DTMF_CHARACTER_WAIT} symbol, this
- * {@code RemoteConnection} will pause playing the tones and notify callbackss via
+ * {@code RemoteConnection} will pause playing the tones and notify callbacks via
* {@link Callback#onPostDialWait(RemoteConnection, String)}. At this point, the in-call app
* should display to the user an indication of this state and an affordance to continue
* the postdial sequence. When the user decides to continue the postdial sequence, the in-call
@@ -777,10 +838,11 @@ public final class RemoteConnection {
/**
* @hide
*/
- void setCallCapabilities(int callCapabilities) {
- mCallCapabilities = callCapabilities;
+ void setConnectionCapabilities(int connectionCapabilities) {
+ mConnectionCapabilities = connectionCapabilities;
for (Callback c : mCallbacks) {
- c.onCallCapabilitiesChanged(this, callCapabilities);
+ c.onConnectionCapabilitiesChanged(this, connectionCapabilities);
+ c.onCallCapabilitiesChanged(this, connectionCapabilities);
}
}
@@ -816,6 +878,15 @@ public final class RemoteConnection {
/**
* @hide
*/
+ void onPostDialChar(char nextChar) {
+ for (Callback c : mCallbacks) {
+ c.onPostDialChar(this, nextChar);
+ }
+ }
+
+ /**
+ * @hide
+ */
void setVideoState(int videoState) {
mVideoState = videoState;
for (Callback c : mCallbacks) {