summaryrefslogtreecommitdiffstats
path: root/telecomm/java/android/telecom/Connection.java
diff options
context:
space:
mode:
Diffstat (limited to 'telecomm/java/android/telecom/Connection.java')
-rw-r--r--telecomm/java/android/telecom/Connection.java173
1 files changed, 126 insertions, 47 deletions
diff --git a/telecomm/java/android/telecom/Connection.java b/telecomm/java/android/telecom/Connection.java
index 00a4136..e79584f 100644
--- a/telecomm/java/android/telecom/Connection.java
+++ b/telecomm/java/android/telecom/Connection.java
@@ -19,7 +19,6 @@ package android.telecom;
import com.android.internal.telecom.IVideoCallback;
import com.android.internal.telecom.IVideoProvider;
-import android.annotation.SystemApi;
import android.net.Uri;
import android.os.Handler;
import android.os.IBinder;
@@ -44,10 +43,8 @@ import java.util.concurrent.ConcurrentHashMap;
* Implementations are then responsible for updating the state of the {@code Connection}, and
* must call {@link #destroy()} to signal to the framework that the {@code Connection} is no
* longer used and associated resources may be recovered.
- * @hide
*/
-@SystemApi
-public abstract class Connection implements IConferenceable {
+public abstract class Connection implements Conferenceable {
public static final int STATE_INITIALIZING = 0;
@@ -106,28 +103,42 @@ public abstract class Connection implements IConferenceable {
public static final int CAPABILITY_MANAGE_CONFERENCE = 0x00000080;
/**
- * Local device supports video telephony.
+ * Local device supports receiving video.
* @hide
*/
- public static final int CAPABILITY_SUPPORTS_VT_LOCAL = 0x00000100;
+ public static final int CAPABILITY_SUPPORTS_VT_LOCAL_RX = 0x00000100;
/**
- * Remote device supports video telephony.
+ * Local device supports transmitting video.
* @hide
*/
- public static final int CAPABILITY_SUPPORTS_VT_REMOTE = 0x00000200;
+ public static final int CAPABILITY_SUPPORTS_VT_LOCAL_TX = 0x00000200;
/**
- * Connection is using high definition audio.
+ * Local device supports bidirectional video calling.
+ * @hide
+ */
+ public static final int CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL =
+ CAPABILITY_SUPPORTS_VT_LOCAL_RX | CAPABILITY_SUPPORTS_VT_LOCAL_TX;
+
+ /**
+ * Remote device supports receiving video.
+ * @hide
+ */
+ public static final int CAPABILITY_SUPPORTS_VT_REMOTE_RX = 0x00000400;
+
+ /**
+ * Remote device supports transmitting video.
* @hide
*/
- public static final int CAPABILITY_HIGH_DEF_AUDIO = 0x00000400;
+ public static final int CAPABILITY_SUPPORTS_VT_REMOTE_TX = 0x00000800;
/**
- * Connection is using voice over WIFI.
+ * Remote device supports bidirectional video calling.
* @hide
*/
- public static final int CAPABILITY_VoWIFI = 0x00000800;
+ public static final int CAPABILITY_SUPPORTS_VT_REMOTE_BIDIRECTIONAL =
+ CAPABILITY_SUPPORTS_VT_REMOTE_RX | CAPABILITY_SUPPORTS_VT_REMOTE_TX;
/**
* Connection is able to be separated from its parent {@code Conference}, if any.
@@ -148,10 +159,46 @@ public abstract class Connection implements IConferenceable {
public static final int CAPABILITY_GENERIC_CONFERENCE = 0x00004000;
/**
+ * Connection is using high definition audio.
+ * @hide
+ */
+ public static final int CAPABILITY_HIGH_DEF_AUDIO = 0x00008000;
+
+ /**
+ * Connection is using WIFI.
+ * @hide
+ */
+ public static final int CAPABILITY_WIFI = 0x00010000;
+
+ /**
+ * Indicates that the current device callback number should be shown.
+ *
+ * @hide
+ */
+ public static final int CAPABILITY_SHOW_CALLBACK_NUMBER = 0x00020000;
+
+ /**
* Speed up audio setup for MT call.
* @hide
- */
- public static final int CAPABILITY_SPEED_UP_MT_AUDIO = 0x00008000;
+ */
+ public static final int CAPABILITY_SPEED_UP_MT_AUDIO = 0x00040000;
+
+ /**
+ * Call can be upgraded to a video call.
+ * @hide
+ */
+ public static final int CAPABILITY_CAN_UPGRADE_TO_VIDEO = 0x00080000;
+
+ /**
+ * For video calls, indicates whether the outgoing video for the call can be paused using
+ * the {@link android.telecom.VideoProfile.VideoState#PAUSED} VideoState.
+ * @hide
+ */
+ public static final int CAPABILITY_CAN_PAUSE_VIDEO = 0x00100000;
+
+ //**********************************************************************************************
+ // Next CAPABILITY value: 0x00200000
+ //**********************************************************************************************
// Flag controlling whether PII is emitted into the logs
private static final boolean PII_DEBUG = Log.isLoggable(android.util.Log.DEBUG);
@@ -224,23 +271,44 @@ public abstract class Connection implements IConferenceable {
if (can(capabilities, CAPABILITY_MANAGE_CONFERENCE)) {
builder.append(" CAPABILITY_MANAGE_CONFERENCE");
}
- if (can(capabilities, CAPABILITY_SUPPORTS_VT_LOCAL)) {
- builder.append(" CAPABILITY_SUPPORTS_VT_LOCAL");
+ if (can(capabilities, CAPABILITY_SUPPORTS_VT_LOCAL_RX)) {
+ builder.append(" CAPABILITY_SUPPORTS_VT_LOCAL_RX");
+ }
+ if (can(capabilities, CAPABILITY_SUPPORTS_VT_LOCAL_TX)) {
+ builder.append(" CAPABILITY_SUPPORTS_VT_LOCAL_TX");
+ }
+ if (can(capabilities, CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL)) {
+ builder.append(" CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL");
}
- if (can(capabilities, CAPABILITY_SUPPORTS_VT_REMOTE)) {
- builder.append(" CAPABILITY_SUPPORTS_VT_REMOTE");
+ if (can(capabilities, CAPABILITY_SUPPORTS_VT_REMOTE_RX)) {
+ builder.append(" CAPABILITY_SUPPORTS_VT_REMOTE_RX");
+ }
+ if (can(capabilities, CAPABILITY_SUPPORTS_VT_REMOTE_TX)) {
+ builder.append(" CAPABILITY_SUPPORTS_VT_REMOTE_TX");
+ }
+ if (can(capabilities, CAPABILITY_SUPPORTS_VT_REMOTE_BIDIRECTIONAL)) {
+ builder.append(" CAPABILITY_SUPPORTS_VT_REMOTE_BIDIRECTIONAL");
}
if (can(capabilities, CAPABILITY_HIGH_DEF_AUDIO)) {
builder.append(" CAPABILITY_HIGH_DEF_AUDIO");
}
- if (can(capabilities, CAPABILITY_VoWIFI)) {
- builder.append(" CAPABILITY_VoWIFI");
+ if (can(capabilities, CAPABILITY_WIFI)) {
+ builder.append(" CAPABILITY_WIFI");
}
if (can(capabilities, CAPABILITY_GENERIC_CONFERENCE)) {
builder.append(" CAPABILITY_GENERIC_CONFERENCE");
}
+ if (can(capabilities, CAPABILITY_SHOW_CALLBACK_NUMBER)) {
+ builder.append(" CAPABILITY_SHOW_CALLBACK_NUMBER");
+ }
if (can(capabilities, CAPABILITY_SPEED_UP_MT_AUDIO)) {
- builder.append(" CAPABILITY_SPEED_UP_IMS_MT_AUDIO");
+ builder.append(" CAPABILITY_SPEED_UP_MT_AUDIO");
+ }
+ if (can(capabilities, CAPABILITY_CAN_UPGRADE_TO_VIDEO)) {
+ builder.append(" CAPABILITY_CAN_UPGRADE_TO_VIDEO");
+ }
+ if (can(capabilities, CAPABILITY_CAN_PAUSE_VIDEO)) {
+ builder.append(" CAPABILITY_CAN_PAUSE_VIDEO");
}
builder.append("]");
return builder.toString();
@@ -264,7 +332,7 @@ public abstract class Connection implements IConferenceable {
public void onAudioModeIsVoipChanged(Connection c, boolean isVoip) {}
public void onStatusHintsChanged(Connection c, StatusHints statusHints) {}
public void onConferenceablesChanged(
- Connection c, List<IConferenceable> conferenceables) {}
+ Connection c, List<Conferenceable> conferenceables) {}
public void onConferenceChanged(Connection c, Conference conference) {}
/** @hide */
public void onConferenceParticipantsChanged(Connection c,
@@ -272,7 +340,6 @@ public abstract class Connection implements IConferenceable {
public void onConferenceStarted() {}
}
- /** @hide */
public static abstract class VideoProvider {
/**
@@ -325,6 +392,16 @@ public abstract class Connection implements IConferenceable {
*/
public static final int SESSION_MODIFY_REQUEST_INVALID = 3;
+ /**
+ * Session modify request timed out.
+ */
+ public static final int SESSION_MODIFY_REQUEST_TIMED_OUT = 4;
+
+ /**
+ * Session modify request rejected by remote UE.
+ */
+ public static final int SESSION_MODIFY_REQUEST_REJECTED_BY_REMOTE = 5;
+
private static final int MSG_SET_VIDEO_CALLBACK = 1;
private static final int MSG_SET_CAMERA = 2;
private static final int MSG_SET_PREVIEW_SURFACE = 3;
@@ -410,7 +487,8 @@ public abstract class Connection implements IConferenceable {
}
public void setDeviceOrientation(int rotation) {
- mMessageHandler.obtainMessage(MSG_SET_DEVICE_ORIENTATION, rotation).sendToTarget();
+ mMessageHandler.obtainMessage(
+ MSG_SET_DEVICE_ORIENTATION, rotation, 0).sendToTarget();
}
public void setZoom(float value) {
@@ -604,7 +682,7 @@ public abstract class Connection implements IConferenceable {
*
* @param dataUsage The updated data usage.
*/
- public void changeCallDataUsage(int dataUsage) {
+ public void changeCallDataUsage(long dataUsage) {
if (mVideoCallback != null) {
try {
mVideoCallback.changeCallDataUsage(dataUsage);
@@ -626,6 +704,20 @@ public abstract class Connection implements IConferenceable {
}
}
}
+
+ /**
+ * Invokes callback method defined in In-Call UI.
+ *
+ * @param videoQuality The updated video quality.
+ */
+ public void changeVideoQuality(int videoQuality) {
+ if (mVideoCallback != null) {
+ try {
+ mVideoCallback.changeVideoQuality(videoQuality);
+ } catch (RemoteException ignored) {
+ }
+ }
+ }
}
private final Listener mConnectionDeathListener = new Listener() {
@@ -653,8 +745,8 @@ public abstract class Connection implements IConferenceable {
*/
private final Set<Listener> mListeners = Collections.newSetFromMap(
new ConcurrentHashMap<Listener, Boolean>(8, 0.9f, 1));
- private final List<IConferenceable> mConferenceables = new ArrayList<>();
- private final List<IConferenceable> mUnmodifiableConferenceables =
+ private final List<Conferenceable> mConferenceables = new ArrayList<>();
+ private final List<Conferenceable> mUnmodifiableConferenceables =
Collections.unmodifiableList(mConferenceables);
private int mState = STATE_NEW;
@@ -849,11 +941,6 @@ public abstract class Connection implements IConferenceable {
return mConnectionCapabilities;
}
- /** @hide */
- @SystemApi @Deprecated public final int getCallCapabilities() {
- return getConnectionCapabilities();
- }
-
/**
* Sets the value of the {@link #getAddress()} property.
*
@@ -970,7 +1057,6 @@ public abstract class Connection implements IConferenceable {
}
}
- /** @hide */
public final VideoProvider getVideoProvider() {
return mVideoProvider;
}
@@ -1011,14 +1097,11 @@ public abstract class Connection implements IConferenceable {
/**
* Informs listeners that this {@code Connection} has processed a character in the post-dial
* started state. This is done when (a) the {@code Connection} is issuing a DTMF sequence;
- * (b) it has encountered a "wait" character; and (c) it wishes to signal Telecom to play
- * the corresponding DTMF tone locally.
+ * and (b) it wishes to signal Telecom to play the corresponding DTMF tone locally.
*
* @param nextChar The DTMF character that was just processed by the {@code Connection}.
- *
- * @hide
*/
- public final void setNextPostDialWaitChar(char nextChar) {
+ public final void setNextPostDialChar(char nextChar) {
checkImmutable();
for (Listener l : mListeners) {
l.onPostDialChar(this, nextChar);
@@ -1041,11 +1124,6 @@ public abstract class Connection implements IConferenceable {
}
}
- /** @hide */
- @SystemApi @Deprecated public final void setCallCapabilities(int connectionCapabilities) {
- setConnectionCapabilities(connectionCapabilities);
- }
-
/**
* Sets the connection's capabilities as a bit mask of the {@code CAPABILITY_*} constants.
*
@@ -1121,9 +1199,9 @@ public abstract class Connection implements IConferenceable {
*
* @param conferenceables The conferenceables.
*/
- public final void setConferenceables(List<IConferenceable> conferenceables) {
+ public final void setConferenceables(List<Conferenceable> conferenceables) {
clearConferenceableList();
- for (IConferenceable c : conferenceables) {
+ for (Conferenceable c : conferenceables) {
// If statement checks for duplicates in input. It makes it N^2 but we're dealing with a
// small amount of items here.
if (!mConferenceables.contains(c)) {
@@ -1143,7 +1221,7 @@ public abstract class Connection implements IConferenceable {
/**
* Returns the connections or conferences with which this connection can be conferenced.
*/
- public final List<IConferenceable> getConferenceables() {
+ public final List<Conferenceable> getConferenceables() {
return mUnmodifiableConferenceables;
}
@@ -1408,7 +1486,7 @@ public abstract class Connection implements IConferenceable {
}
private final void clearConferenceableList() {
- for (IConferenceable c : mConferenceables) {
+ for (Conferenceable c : mConferenceables) {
if (c instanceof Connection) {
Connection connection = (Connection) c;
connection.removeConnectionListener(mConnectionDeathListener);
@@ -1435,6 +1513,7 @@ public abstract class Connection implements IConferenceable {
/**
* Notifies listeners that a conference call has been started.
+ * @hide
*/
protected void notifyConferenceStarted() {
for (Listener l : mListeners) {