summaryrefslogtreecommitdiffstats
path: root/telecomm
diff options
context:
space:
mode:
authorSantos Cordon <santoscordon@google.com>2014-06-04 20:20:58 -0700
committerSantos Cordon <santoscordon@google.com>2014-06-12 16:15:09 -0700
commitb693998fdfdd4498a33c4c69405f2708e4840aa7 (patch)
tree3bf5a89f8cd3605ecfa8e9d548fd631ac8c62120 /telecomm
parent7f2cd8df473c82cc10d1914cd563ba1b63e22a54 (diff)
downloadframeworks_base-b693998fdfdd4498a33c4c69405f2708e4840aa7.zip
frameworks_base-b693998fdfdd4498a33c4c69405f2708e4840aa7.tar.gz
frameworks_base-b693998fdfdd4498a33c4c69405f2708e4840aa7.tar.bz2
Support conference calling. (1/4)
Bug: 15006702 Change-Id: I2764ea242f783ba478c9eae86618dd33e9fc792a
Diffstat (limited to 'telecomm')
-rw-r--r--telecomm/java/android/telecomm/CallCapabilities.java50
-rw-r--r--telecomm/java/android/telecomm/CallService.java46
-rw-r--r--telecomm/java/android/telecomm/CallServiceAdapter.java25
-rw-r--r--telecomm/java/android/telecomm/Connection.java122
-rw-r--r--telecomm/java/android/telecomm/ConnectionService.java113
-rw-r--r--telecomm/java/android/telecomm/InCallAdapter.java9
-rw-r--r--telecomm/java/android/telecomm/InCallCall.java24
-rw-r--r--telecomm/java/com/android/internal/telecomm/ICallService.aidl4
-rw-r--r--telecomm/java/com/android/internal/telecomm/ICallServiceAdapter.aidl6
-rw-r--r--telecomm/java/com/android/internal/telecomm/IInCallAdapter.aidl2
10 files changed, 309 insertions, 92 deletions
diff --git a/telecomm/java/android/telecomm/CallCapabilities.java b/telecomm/java/android/telecomm/CallCapabilities.java
index b2b33a3..5aff19c 100644
--- a/telecomm/java/android/telecomm/CallCapabilities.java
+++ b/telecomm/java/android/telecomm/CallCapabilities.java
@@ -17,7 +17,7 @@
package android.telecomm;
/** Defines actions a call currently supports. */
-public class CallCapabilities {
+public final class CallCapabilities {
/** Call can currently be put on hold or unheld. */
public static final int HOLD = 0x00000001;
@@ -27,24 +27,60 @@ public class CallCapabilities {
/** Call can currently be merged. */
public static final int MERGE_CALLS = 0x00000004;
- /* Call can currently be swapped with another call. */
+ /** Call can currently be swapped with another call. */
public static final int SWAP_CALLS = 0x00000008;
- /* Call currently supports adding another call to this one. */
+ /** Call currently supports adding another call to this one. */
public static final int ADD_CALL = 0x00000010;
- /* Call supports responding via text option. */
+ /** Call supports responding via text option. */
public static final int RESPOND_VIA_TEXT = 0x00000020;
- /* Call can be muted. */
+ /** Call can be muted. */
public static final int MUTE = 0x00000040;
- /* Call supports generic conference mode. */
+ /** Call supports generic conference mode. */
public static final int GENERIC_CONFERENCE = 0x00000080;
- /* Call currently supports switch between connections. */
+ /** Call currently supports switch between connections. */
public static final int CONNECTION_HANDOFF = 0x00000100;
public static final int ALL = HOLD | SUPPORT_HOLD | MERGE_CALLS | SWAP_CALLS | ADD_CALL
| RESPOND_VIA_TEXT | MUTE | GENERIC_CONFERENCE | CONNECTION_HANDOFF;
+
+ public static String toString(int capabilities) {
+ StringBuilder builder = new StringBuilder();
+ builder.append("[Capabilities:");
+ if ((capabilities & HOLD) != 0) {
+ builder.append(" HOLD");
+ }
+ if ((capabilities & SUPPORT_HOLD) != 0) {
+ builder.append(" SUPPORT_HOLD");
+ }
+ if ((capabilities & MERGE_CALLS) != 0) {
+ builder.append(" MERGE_CALLS");
+ }
+ if ((capabilities & SWAP_CALLS) != 0) {
+ builder.append(" SWAP_CALLS");
+ }
+ if ((capabilities & ADD_CALL) != 0) {
+ builder.append(" ADD_CALL");
+ }
+ if ((capabilities & RESPOND_VIA_TEXT) != 0) {
+ builder.append(" RESPOND_VIA_TEXT");
+ }
+ if ((capabilities & MUTE) != 0) {
+ builder.append(" MUTE");
+ }
+ if ((capabilities & GENERIC_CONFERENCE) != 0) {
+ builder.append(" GENERIC_CONFERENCE");
+ }
+ if ((capabilities & CONNECTION_HANDOFF) != 0) {
+ builder.append(" HANDOFF");
+ }
+ builder.append("]");
+ return builder.toString();
+ }
+
+ private CallCapabilities() {}
}
diff --git a/telecomm/java/android/telecomm/CallService.java b/telecomm/java/android/telecomm/CallService.java
index a254459..0b5981c 100644
--- a/telecomm/java/android/telecomm/CallService.java
+++ b/telecomm/java/android/telecomm/CallService.java
@@ -61,7 +61,7 @@ public abstract class CallService extends Service {
private static final int MSG_ON_AUDIO_STATE_CHANGED = 11;
private static final int MSG_PLAY_DTMF_TONE = 12;
private static final int MSG_STOP_DTMF_TONE = 13;
- private static final int MSG_ADD_TO_CONFERENCE = 14;
+ private static final int MSG_CONFERENCE = 14;
private static final int MSG_SPLIT_FROM_CONFERENCE = 15;
private static final int MSG_ON_POST_DIAL_CONTINUE = 16;
@@ -128,24 +128,12 @@ public abstract class CallService extends Service {
case MSG_STOP_DTMF_TONE:
stopDtmfTone((String) msg.obj);
break;
- case MSG_ADD_TO_CONFERENCE: {
- SomeArgs args = (SomeArgs) msg.obj;
- try {
- @SuppressWarnings("unchecked")
- List<String> callIds = (List<String>) args.arg2;
- String conferenceCallId = (String) args.arg1;
- addToConference(conferenceCallId, callIds);
- } finally {
- args.recycle();
- }
- break;
- }
- case MSG_SPLIT_FROM_CONFERENCE: {
+ case MSG_CONFERENCE: {
SomeArgs args = (SomeArgs) msg.obj;
try {
String conferenceCallId = (String) args.arg1;
String callId = (String) args.arg2;
- splitFromConference(conferenceCallId, callId);
+ conference(conferenceCallId, callId);
} finally {
args.recycle();
}
@@ -162,6 +150,9 @@ public abstract class CallService extends Service {
}
break;
}
+ case MSG_SPLIT_FROM_CONFERENCE:
+ splitFromConference((String) msg.obj);
+ break;
default:
break;
}
@@ -245,19 +236,16 @@ public abstract class CallService extends Service {
}
@Override
- public void addToConference(String conferenceCallId, List<String> callsToConference) {
+ public void conference(String conferenceCallId, String callId) {
SomeArgs args = SomeArgs.obtain();
args.arg1 = conferenceCallId;
- args.arg2 = callsToConference;
- mMessageHandler.obtainMessage(MSG_ADD_TO_CONFERENCE, args).sendToTarget();
+ args.arg2 = callId;
+ mMessageHandler.obtainMessage(MSG_CONFERENCE, args).sendToTarget();
}
@Override
- public void splitFromConference(String conferenceCallId, String callId) {
- SomeArgs args = SomeArgs.obtain();
- args.arg1 = conferenceCallId;
- args.arg2 = callId;
- mMessageHandler.obtainMessage(MSG_SPLIT_FROM_CONFERENCE, args).sendToTarget();
+ public void splitFromConference(String callId) {
+ mMessageHandler.obtainMessage(MSG_SPLIT_FROM_CONFERENCE, callId).sendToTarget();
}
@Override
@@ -424,24 +412,22 @@ public abstract class CallService extends Service {
public abstract void onAudioStateChanged(String activeCallId, CallAudioState audioState);
/**
- * Adds the specified calls to the specified conference call.
+ * Conferences the specified call.
*
* @param conferenceCallId The unique ID of the conference call onto which the specified calls
* should be added.
- * @param callIds The calls to add to the conference call.
+ * @param callId The call to conference.
* @hide
*/
- public abstract void addToConference(String conferenceCallId, List<String> callIds);
+ public abstract void conference(String conferenceCallId, String callId);
/**
- * Removes the specified call from the specified conference call. This is a no-op if the call
- * is not already part of the conference call.
+ * Removes the specified call from a conference call.
*
- * @param conferenceCallId The conference call.
* @param callId The call to remove from the conference call
* @hide
*/
- public abstract void splitFromConference(String conferenceCallId, String callId);
+ public abstract void splitFromConference(String callId);
public void onPostDialContinue(String callId, boolean proceed) {}
public void onPostDialWait(Connection conn, String remaining) {}
diff --git a/telecomm/java/android/telecomm/CallServiceAdapter.java b/telecomm/java/android/telecomm/CallServiceAdapter.java
index 8c3ddad..0ba8161 100644
--- a/telecomm/java/android/telecomm/CallServiceAdapter.java
+++ b/telecomm/java/android/telecomm/CallServiceAdapter.java
@@ -179,12 +179,12 @@ public final class CallServiceAdapter {
* Indicates that the specified call can conference with any of the specified list of calls.
*
* @param callId The unique ID of the call.
- * @param conferenceCapableCallIds The unique IDs of the calls which can be conferenced.
+ * @param canConference Specified whether or not the call can be conferenced.
* @hide
*/
- public void setCanConferenceWith(String callId, List<String> conferenceCapableCallIds) {
+ public void setCanConference(String callId, boolean canConference) {
try {
- mAdapter.setCanConferenceWith(callId, conferenceCapableCallIds);
+ mAdapter.setCanConference(callId, canConference);
} catch (RemoteException ignored) {
}
}
@@ -193,13 +193,14 @@ public final class CallServiceAdapter {
* Indicates whether or not the specified call is currently conferenced into the specified
* conference call.
*
- * @param conferenceCallId The unique ID of the conference call.
* @param callId The unique ID of the call being conferenced.
+ * @param conferenceCallId The unique ID of the conference call. Null if call is not
+ * conferenced.
* @hide
*/
- public void setIsConferenced(String conferenceCallId, String callId, boolean isConferenced) {
+ public void setIsConferenced(String callId, String conferenceCallId) {
try {
- mAdapter.setIsConferenced(conferenceCallId, callId, isConferenced);
+ mAdapter.setIsConferenced(callId, conferenceCallId);
} catch (RemoteException ignored) {
}
}
@@ -236,4 +237,16 @@ public final class CallServiceAdapter {
} catch (RemoteException e) {
}
}
+
+ /**
+ * Indicates that a new conference call has been created.
+ *
+ * @param callId The unique ID of the conference call.
+ */
+ public void addConferenceCall(String callId) {
+ try {
+ mAdapter.addConferenceCall(callId, null);
+ } catch (RemoteException ignored) {
+ }
+ }
}
diff --git a/telecomm/java/android/telecomm/Connection.java b/telecomm/java/android/telecomm/Connection.java
index 344814f..7aee770 100644
--- a/telecomm/java/android/telecomm/Connection.java
+++ b/telecomm/java/android/telecomm/Connection.java
@@ -19,7 +19,10 @@ package android.telecomm;
import android.net.Uri;
import android.os.Bundle;
+import java.util.ArrayList;
+import java.util.Collections;
import java.util.HashSet;
+import java.util.List;
import java.util.Set;
/**
@@ -35,6 +38,8 @@ public abstract class Connection {
void onDisconnected(Connection c, int cause, String message);
void onRequestingRingback(Connection c, boolean ringback);
void onDestroyed(Connection c);
+ void onConferenceCapableChanged(Connection c, boolean isConferenceCapable);
+ void onParentConnectionChanged(Connection c, Connection parent);
}
public static class ListenerBase implements Listener {
@@ -65,6 +70,14 @@ public abstract class Connection {
/** {@inheritDoc} */
@Override
public void onRequestingRingback(Connection c, boolean ringback) {}
+
+ /** ${inheritDoc} */
+ @Override
+ public void onConferenceCapableChanged(Connection c, boolean isConferenceCapable) {}
+
+ /** ${inheritDoc} */
+ @Override
+ public void onParentConnectionChanged(Connection c, Connection parent) {}
}
public final class State {
@@ -79,10 +92,14 @@ public abstract class Connection {
}
private final Set<Listener> mListeners = new HashSet<>();
+ private final List<Connection> mChildConnections = new ArrayList<>();
+
private int mState = State.NEW;
private CallAudioState mCallAudioState;
private Uri mHandle;
private boolean mRequestingRingback = false;
+ private boolean mIsConferenceCapable = false;
+ private Connection mParentConnection;
/**
* Create a new Connection.
@@ -176,6 +193,16 @@ public abstract class Connection {
}
/**
+ * Separates this Connection from a parent connection.
+ *
+ * @hide
+ */
+ public final void separate() {
+ Log.d(this, "separate");
+ onSeparate();
+ }
+
+ /**
* Abort this Connection. The Connection will immediately transition to
* the {@link State#DISCONNECTED} state, and send no notifications of this
* or any other future events.
@@ -240,6 +267,14 @@ public abstract class Connection {
}
/**
+ * TODO(santoscordon): Needs updated documentation.
+ */
+ public final void conference() {
+ Log.d(this, "conference");
+ onConference();
+ }
+
+ /**
* Inform this Connection that the state of its audio output has been changed externally.
*
* @param state The new audio state.
@@ -274,7 +309,7 @@ public abstract class Connection {
}
/**
- * @return Whether this connection is requesting that the system play a ringback tone
+ * Returns whether this connection is requesting that the system play a ringback tone
* on its behalf.
*/
public boolean isRequestingRingback() {
@@ -282,6 +317,38 @@ public abstract class Connection {
}
/**
+ * Returns whether this connection is a conference connection (has child connections).
+ */
+ public boolean isConferenceConnection() {
+ return !mChildConnections.isEmpty();
+ }
+
+ public void setParentConnection(Connection parentConnection) {
+ Log.d(this, "parenting %s to %s", this, parentConnection);
+ if (mParentConnection != parentConnection) {
+ if (mParentConnection != null) {
+ mParentConnection.removeChild(this);
+ }
+ mParentConnection = parentConnection;
+ if (mParentConnection != null) {
+ mParentConnection.addChild(this);
+ // do something if the child connections goes down to ZERO.
+ }
+ for (Listener l : mListeners) {
+ l.onParentConnectionChanged(this, mParentConnection);
+ }
+ }
+ }
+
+ public Connection getParentConnection() {
+ return mParentConnection;
+ }
+
+ public List<Connection> getChildConnections() {
+ return mChildConnections;
+ }
+
+ /**
* Sets the value of the {@link #getHandle()} property and notifies listeners.
*
* @param handle The new handle.
@@ -359,6 +426,32 @@ public abstract class Connection {
}
/**
+ * TODO(santoscordon): Needs documentation.
+ */
+ protected void setIsConferenceCapable(boolean isConferenceCapable) {
+ if (mIsConferenceCapable != isConferenceCapable) {
+ mIsConferenceCapable = isConferenceCapable;
+ for (Listener l : mListeners) {
+ l.onConferenceCapableChanged(this, mIsConferenceCapable);
+ }
+ }
+ }
+
+ /**
+ * TODO(santoscordon): Needs documentation.
+ */
+ protected void setDestroyed() {
+ // It is possible that onDestroy() will trigger the listener to remove itself which will
+ // result in a concurrent modification exception. To counteract this we make a copy of the
+ // listeners and iterate on that.
+ for (Listener l : new ArrayList<>(mListeners)) {
+ if (mListeners.contains(l)) {
+ l.onDestroyed(this);
+ }
+ }
+ }
+
+ /**
* Notifies this Connection and listeners that the {@link #getCallAudioState()} property
* has a new value.
*
@@ -418,6 +511,11 @@ public abstract class Connection {
protected void onDisconnect() {}
/**
+ * Notifies this Connection of a request to disconnect.
+ */
+ protected void onSeparate() {}
+
+ /**
* Notifies this Connection of a request to abort.
*/
protected void onAbort() {}
@@ -449,6 +547,28 @@ public abstract class Connection {
*/
protected void onPostDialContinue(boolean proceed) {}
+ /**
+ * TODO(santoscordon): Needs documentation.
+ */
+ protected void onConference() {}
+
+ /**
+ * TODO(santoscordon): Needs documentation.
+ */
+ protected void onChildrenChanged(List<Connection> children) {}
+
+ private void addChild(Connection connection) {
+ Log.d(this, "adding child %s", connection);
+ mChildConnections.add(connection);
+ onChildrenChanged(mChildConnections);
+ }
+
+ private void removeChild(Connection connection) {
+ Log.d(this, "removing child %s", connection);
+ mChildConnections.remove(connection);
+ onChildrenChanged(mChildConnections);
+ }
+
private void setState(int state) {
Log.d(this, "setState: %s", stateToString(state));
onSetState(state);
diff --git a/telecomm/java/android/telecomm/ConnectionService.java b/telecomm/java/android/telecomm/ConnectionService.java
index 59e977d..9dfad2d 100644
--- a/telecomm/java/android/telecomm/ConnectionService.java
+++ b/telecomm/java/android/telecomm/ConnectionService.java
@@ -20,10 +20,15 @@ import android.net.Uri;
import android.os.Bundle;
import android.telephony.DisconnectCause;
+import android.os.SystemClock;
+
+import java.util.Collection;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
+import java.util.Set;
/**
* A {@link android.app.Service} that provides telephone connections to
@@ -32,7 +37,6 @@ import java.util.Map;
public abstract class ConnectionService extends CallService {
// Flag controlling whether PII is emitted into the logs
private static final boolean PII_DEBUG = Log.isLoggable(android.util.Log.DEBUG);
-
private static final Connection NULL_CONNECTION = new Connection() {};
// Mappings from Connections to IDs as understood by the current CallService implementation
@@ -99,6 +103,20 @@ public abstract class ConnectionService extends CallService {
Log.d(this, "Adapter onRingback %b", ringback);
getAdapter().setRequestingRingback(id, ringback);
}
+
+ @Override
+ public void onConferenceCapableChanged(Connection c, boolean isConferenceCapable) {
+ String id = mIdByConnection.get(c);
+ getAdapter().setCanConference(id, isConferenceCapable);
+ }
+
+ /** ${inheritDoc} */
+ @Override
+ public void onParentConnectionChanged(Connection c, Connection parent) {
+ String id = mIdByConnection.get(c);
+ String parentId = parent == null ? null : mIdByConnection.get(parent);
+ getAdapter().setIsConferenced(id, parentId);
+ }
};
@Override
@@ -110,8 +128,7 @@ public abstract class ConnectionService extends CallService {
@Override
public void onResult(Uri handle, Subscription... result) {
boolean isCompatible = result.length > 0;
- Log.d(this, "adapter setIsCompatibleWith "
- + callInfo.getId() + " " + isCompatible);
+ Log.d(this, "adapter setIsCompatibleWith ");
getAdapter().setIsCompatibleWith(callInfo.getId(), isCompatible);
}
@@ -135,7 +152,7 @@ public abstract class ConnectionService extends CallService {
new Response<ConnectionRequest, Connection>() {
@Override
public void onResult(ConnectionRequest request, Connection... result) {
- if (result.length != 1) {
+ if (result != null && result.length != 1) {
Log.d(this, "adapter handleFailedOutgoingCall %s", callInfo);
getAdapter().handleFailedOutgoingCall(
request,
@@ -145,10 +162,10 @@ public abstract class ConnectionService extends CallService {
c.abort();
}
} else {
- addConnection(callInfo.getId(), result[0]);
Log.d(this, "adapter handleSuccessfulOutgoingCall %s",
callInfo.getId());
getAdapter().handleSuccessfulOutgoingCall(callInfo.getId());
+ addConnection(callInfo.getId(), result[0]);
}
}
@@ -177,7 +194,7 @@ public abstract class ConnectionService extends CallService {
new Response<ConnectionRequest, Connection>() {
@Override
public void onResult(ConnectionRequest request, Connection... result) {
- if (result.length != 1) {
+ if (result != null && result.length != 1) {
Log.d(this, "adapter handleFailedOutgoingCall %s", callId);
getAdapter().handleFailedOutgoingCall(
request,
@@ -258,27 +275,43 @@ public abstract class ConnectionService extends CallService {
/** @hide */
@Override
- public final void addToConference(String conferenceCallId, List<String> callIds) {
- Log.d(this, "addToConference %s, %s", conferenceCallId, callIds);
-
- List<Connection> connections = new LinkedList<>();
- for (String id : callIds) {
- Connection connection = findConnectionForAction(id, "addToConference");
- if (connection == NULL_CONNECTION) {
- Log.w(this, "Connection missing in conference request %s.", id);
- return;
- }
- connections.add(connection);
+ public final void conference(final String conferenceCallId, String callId) {
+ Log.d(this, "conference %s, %s", conferenceCallId, callId);
+
+ Connection connection = findConnectionForAction(callId, "conference");
+ if (connection == NULL_CONNECTION) {
+ Log.w(this, "Connection missing in conference request %s.", callId);
+ return;
}
- // TODO(santoscordon): Find an existing conference call or create a new one. Then call
- // conferenceWith on it.
+ onCreateConferenceConnection(conferenceCallId, connection,
+ new Response<String, Connection>() {
+ /** ${inheritDoc} */
+ @Override
+ public void onResult(String ignored, Connection... result) {
+ Log.d(this, "onCreateConference.Response %s", (Object[]) result);
+ if (result != null && result.length == 1) {
+ Connection conferenceConnection = result[0];
+ if (!mIdByConnection.containsKey(conferenceConnection)) {
+ Log.v(this, "sending new conference call %s", conferenceCallId);
+ getAdapter().addConferenceCall(conferenceCallId);
+ addConnection(conferenceCallId, conferenceConnection);
+ }
+ }
+ }
+
+ /** ${inheritDoc} */
+ @Override
+ public void onError(String request, int code, String reason) {
+ // no-op
+ }
+ });
}
/** @hide */
@Override
- public final void splitFromConference(String conferenceCallId, String callId) {
- Log.d(this, "splitFromConference(%s, %s)", conferenceCallId, callId);
+ public final void splitFromConference(String callId) {
+ Log.d(this, "splitFromConference(%s)", callId);
Connection connection = findConnectionForAction(callId, "splitFromConference");
if (connection == NULL_CONNECTION) {
@@ -309,6 +342,13 @@ public abstract class ConnectionService extends CallService {
}
/**
+ * Returns all connections currently associated with this connection service.
+ */
+ public Collection<Connection> getAllConnections() {
+ return mConnectionById.values();
+ }
+
+ /**
* Find a set of Subscriptions matching a given handle (e.g. phone number).
*
* @param handle A handle (e.g. phone number) with which to connect.
@@ -329,6 +369,21 @@ public abstract class ConnectionService extends CallService {
Response<ConnectionRequest, Connection> callback) {}
/**
+ * Returns a new or existing conference connection when the the user elects to convert the
+ * specified connection into a conference call. The specified connection can be any connection
+ * which had previously specified itself as conference-capable including both simple connections
+ * and connections previously returned from this method.
+ *
+ * @param connection The connection from which the user opted to start a conference call.
+ * @param token The token to be passed into the response callback.
+ * @param callback The callback for providing the potentially-new conference connection.
+ */
+ public void onCreateConferenceConnection(
+ String token,
+ Connection connection,
+ Response<String, Connection> callback) {}
+
+ /**
* Create a Connection to match an incoming connection notification.
*
* @param request Data encapsulating details of the desired Connection.
@@ -338,6 +393,20 @@ public abstract class ConnectionService extends CallService {
ConnectionRequest request,
Response<ConnectionRequest, Connection> callback) {}
+ /**
+ * Notifies that a connection has been added to this connection service and sent to Telecomm.
+ *
+ * @param connection The connection which was added.
+ */
+ public void onConnectionAdded(Connection connection) {}
+
+ /**
+ * Notified that a connection has been removed from this connection service.
+ *
+ * @param connection The connection which was removed.
+ */
+ public void onConnectionRemoved(Connection connection) {}
+
static String toLogSafePhoneNumber(String number) {
// For unknown number, log empty string.
if (number == null) {
@@ -387,12 +456,14 @@ public abstract class ConnectionService extends CallService {
mConnectionById.put(callId, connection);
mIdByConnection.put(connection, callId);
connection.addConnectionListener(mConnectionListener);
+ onConnectionAdded(connection);
}
private void removeConnection(Connection connection) {
connection.removeConnectionListener(mConnectionListener);
mConnectionById.remove(mIdByConnection.get(connection));
mIdByConnection.remove(connection);
+ onConnectionRemoved(connection);
}
private Connection findConnectionForAction(String callId, String action) {
diff --git a/telecomm/java/android/telecomm/InCallAdapter.java b/telecomm/java/android/telecomm/InCallAdapter.java
index 0bef419..86b7a50 100644
--- a/telecomm/java/android/telecomm/InCallAdapter.java
+++ b/telecomm/java/android/telecomm/InCallAdapter.java
@@ -199,15 +199,14 @@ public final class InCallAdapter {
}
/**
- * Instructs Telecomm to conference the specified calls together.
+ * Instructs Telecomm to conference the specified call.
*
* @param callId The unique ID of the call.
- * @param callIdToConference The unique ID of the call to conference with.
* @hide
*/
- void conferenceWith(String callId, String callIdToConference) {
+ public void conference(String callId) {
try {
- mAdapter.conferenceWith(callId, callIdToConference);
+ mAdapter.conference(callId);
} catch (RemoteException ignored) {
}
}
@@ -219,7 +218,7 @@ public final class InCallAdapter {
* @param callId The unique ID of the call.
* @hide
*/
- void splitFromConference(String callId) {
+ public void splitFromConference(String callId) {
try {
mAdapter.splitFromConference(callId);
} catch (RemoteException ignored) {
diff --git a/telecomm/java/android/telecomm/InCallCall.java b/telecomm/java/android/telecomm/InCallCall.java
index b531ccd..432e378 100644
--- a/telecomm/java/android/telecomm/InCallCall.java
+++ b/telecomm/java/android/telecomm/InCallCall.java
@@ -39,7 +39,6 @@ public final class InCallCall implements Parcelable {
private final GatewayInfo mGatewayInfo;
private final CallServiceDescriptor mCurrentCallServiceDescriptor;
private final CallServiceDescriptor mHandoffCallServiceDescriptor;
- private final List<String> mConferenceCapableCallIds;
private final String mParentCallId;
private final List<String> mChildCallIds;
@@ -57,8 +56,7 @@ public final class InCallCall implements Parcelable {
CallServiceDescriptor descriptor,
CallServiceDescriptor handoffDescriptor) {
this(id, state, disconnectCauseCode, disconnectCauseMsg, capabilities, connectTimeMillis,
- handle, gatewayInfo, descriptor, handoffDescriptor, Collections.EMPTY_LIST, null,
- Collections.EMPTY_LIST);
+ handle, gatewayInfo, descriptor, handoffDescriptor, null, Collections.EMPTY_LIST);
}
/** @hide */
@@ -73,7 +71,6 @@ public final class InCallCall implements Parcelable {
GatewayInfo gatewayInfo,
CallServiceDescriptor descriptor,
CallServiceDescriptor handoffDescriptor,
- List<String> conferenceCapableCallIds,
String parentCallId,
List<String> childCallIds) {
mId = id;
@@ -86,7 +83,6 @@ public final class InCallCall implements Parcelable {
mGatewayInfo = gatewayInfo;
mCurrentCallServiceDescriptor = descriptor;
mHandoffCallServiceDescriptor = handoffDescriptor;
- mConferenceCapableCallIds = conferenceCapableCallIds;
mParentCallId = parentCallId;
mChildCallIds = childCallIds;
}
@@ -151,14 +147,6 @@ public final class InCallCall implements Parcelable {
}
/**
- * The calls with which this call can conference.
- * @hide
- */
- public List<String> getConferenceCapableCallIds() {
- return mConferenceCapableCallIds;
- }
-
- /**
* The conference call to which this call is conferenced. Null if not conferenced.
* @hide
*/
@@ -191,14 +179,12 @@ public final class InCallCall implements Parcelable {
GatewayInfo gatewayInfo = source.readParcelable(classLoader);
CallServiceDescriptor descriptor = source.readParcelable(classLoader);
CallServiceDescriptor handoffDescriptor = source.readParcelable(classLoader);
- List<String> conferenceCapableCallIds = new ArrayList<>();
- source.readList(conferenceCapableCallIds, classLoader);
String parentCallId = source.readString();
List<String> childCallIds = new ArrayList<>();
source.readList(childCallIds, classLoader);
return new InCallCall(id, state, disconnectCauseCode, disconnectCauseMsg, capabilities,
connectTimeMillis, handle, gatewayInfo, descriptor, handoffDescriptor,
- conferenceCapableCallIds, parentCallId, childCallIds);
+ parentCallId, childCallIds);
}
@Override
@@ -226,8 +212,12 @@ public final class InCallCall implements Parcelable {
destination.writeParcelable(mGatewayInfo, 0);
destination.writeParcelable(mCurrentCallServiceDescriptor, 0);
destination.writeParcelable(mHandoffCallServiceDescriptor, 0);
- destination.writeList(mConferenceCapableCallIds);
destination.writeString(mParentCallId);
destination.writeList(mChildCallIds);
}
+
+ @Override
+ public String toString() {
+ return String.format("[%s, parent:%s, children:%s]", mId, mParentCallId, mChildCallIds);
+ }
}
diff --git a/telecomm/java/com/android/internal/telecomm/ICallService.aidl b/telecomm/java/com/android/internal/telecomm/ICallService.aidl
index 9139aa6..827f331 100644
--- a/telecomm/java/com/android/internal/telecomm/ICallService.aidl
+++ b/telecomm/java/com/android/internal/telecomm/ICallService.aidl
@@ -56,9 +56,9 @@ oneway interface ICallService {
void stopDtmfTone(String callId);
- void addToConference(String conferenceCallId, in List<String> callIds);
+ void conference(String conferenceCallId, String callId);
- void splitFromConference(String conferenceCallId, String callId);
+ void splitFromConference(String callId);
void onPostDialContinue(String callId, boolean proceed);
}
diff --git a/telecomm/java/com/android/internal/telecomm/ICallServiceAdapter.aidl b/telecomm/java/com/android/internal/telecomm/ICallServiceAdapter.aidl
index b380293..6e176eb 100644
--- a/telecomm/java/com/android/internal/telecomm/ICallServiceAdapter.aidl
+++ b/telecomm/java/com/android/internal/telecomm/ICallServiceAdapter.aidl
@@ -47,9 +47,11 @@ oneway interface ICallServiceAdapter {
void setRequestingRingback(String callId, boolean ringing);
- void setCanConferenceWith(String callId, in List<String> conferenceCapableCallIds);
+ void setCanConference(String callId, boolean canConference);
- void setIsConferenced(String conferenceCallId, String callId, boolean isConferenced);
+ void setIsConferenced(String callId, String conferenceCallId);
+
+ void addConferenceCall(String callId, in CallInfo callInfo);
void removeCall(String callId);
diff --git a/telecomm/java/com/android/internal/telecomm/IInCallAdapter.aidl b/telecomm/java/com/android/internal/telecomm/IInCallAdapter.aidl
index f144043..5717456 100644
--- a/telecomm/java/com/android/internal/telecomm/IInCallAdapter.aidl
+++ b/telecomm/java/com/android/internal/telecomm/IInCallAdapter.aidl
@@ -48,7 +48,7 @@ oneway interface IInCallAdapter {
void handoffCall(String callId);
- void conferenceWith(String callId, String callIdToConference);
+ void conference(String callId);
void splitFromConference(String callId);
}