summaryrefslogtreecommitdiffstats
path: root/telecomm
diff options
context:
space:
mode:
authorSantos Cordon <santoscordon@google.com>2014-07-28 18:15:48 -0700
committerSantos Cordon <santoscordon@google.com>2014-08-06 03:36:09 -0700
commit7c7bc7f6917484250974c5da00af9ef756844b0a (patch)
tree86799cdb91972735a4bf94c92993790176459d71 /telecomm
parent022e7cc2985046af45e4b0a2fce78870f6e6dfac (diff)
downloadframeworks_base-7c7bc7f6917484250974c5da00af9ef756844b0a.zip
frameworks_base-7c7bc7f6917484250974c5da00af9ef756844b0a.tar.gz
frameworks_base-7c7bc7f6917484250974c5da00af9ef756844b0a.tar.bz2
Add setConferenceable() API from ConnectionService to incall. (1/4)
Change-Id: I64fdca08d35f893d755e3b154543a261b1418343
Diffstat (limited to 'telecomm')
-rw-r--r--telecomm/java/android/telecomm/Call.java64
-rw-r--r--telecomm/java/android/telecomm/Connection.java62
-rw-r--r--telecomm/java/android/telecomm/ConnectionService.java43
-rw-r--r--telecomm/java/android/telecomm/ConnectionServiceAdapter.java10
-rw-r--r--telecomm/java/android/telecomm/ConnectionServiceAdapterServant.java32
-rw-r--r--telecomm/java/android/telecomm/InCallAdapter.java4
-rw-r--r--telecomm/java/android/telecomm/ParcelableCall.java18
-rw-r--r--telecomm/java/android/telecomm/ParcelableConnection.java12
-rw-r--r--telecomm/java/android/telecomm/Phone.java4
-rw-r--r--telecomm/java/android/telecomm/RemoteConnection.java15
-rw-r--r--telecomm/java/android/telecomm/RemoteConnectionService.java14
-rw-r--r--telecomm/java/com/android/internal/telecomm/IConnectionServiceAdapter.aidl2
-rw-r--r--telecomm/java/com/android/internal/telecomm/IInCallAdapter.aidl2
13 files changed, 249 insertions, 33 deletions
diff --git a/telecomm/java/android/telecomm/Call.java b/telecomm/java/android/telecomm/Call.java
index 3a04632..4e9e604 100644
--- a/telecomm/java/android/telecomm/Call.java
+++ b/telecomm/java/android/telecomm/Call.java
@@ -24,6 +24,7 @@ import java.lang.String;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
+import java.util.Map;
import java.util.Objects;
/**
@@ -326,20 +327,34 @@ public final class Call {
* @param call The {@code Call} being destroyed.
*/
public void onCallDestroyed(Call call) {}
+
+ /**
+ * Invoked upon changes to the set of {@code Call}s with which this {@code Call} can be
+ * conferenced.
+ *
+ * @param call The {@code Call} being updated.
+ * @param conferenceableCalls The {@code Call}s with which this {@code Call} can be
+ * conferenced.
+ */
+ public void onConferenceableCallsChanged(Call call, List<Call> conferenceableCalls) {}
}
private final Phone mPhone;
private final String mTelecommCallId;
private final InCallAdapter mInCallAdapter;
- private Call mParent = null;
- private int mState;
private final List<Call> mChildren = new ArrayList<>();
private final List<Call> mUnmodifiableChildren = Collections.unmodifiableList(mChildren);
+ private final List<Listener> mListeners = new ArrayList<>();
+ private final List<Call> mConferenceableCalls = new ArrayList<>();
+ private final List<Call> mUnmodifiableConferenceableCalls =
+ Collections.unmodifiableList(mConferenceableCalls);
+
+ private Call mParent = null;
+ private int mState;
private List<String> mCannedTextResponses = null;
private String mRemainingPostDialSequence;
private InCallService.VideoCall mVideoCall;
private Details mDetails;
- private final List<Listener> mListeners = new ArrayList<>();
/**
* Obtains the post-dial sequence remaining to be emitted by this {@code Call}, if any.
@@ -455,9 +470,13 @@ public final class Call {
/**
* Instructs this {@code Call} to enter a conference.
+ *
+ * @param callToConferenceWith The other call with which to conference.
*/
- public void conference() {
- mInCallAdapter.conference(mTelecommCallId);
+ public void conference(Call callToConferenceWith) {
+ if (callToConferenceWith != null) {
+ mInCallAdapter.conference(mTelecommCallId, callToConferenceWith.mTelecommCallId);
+ }
}
/**
@@ -497,6 +516,15 @@ public final class Call {
}
/**
+ * Returns the list of {@code Call}s with which this {@code Call} is allowed to conference.
+ *
+ * @return The list of conferenceable {@code Call}s.
+ */
+ public List<Call> getConferenceableCalls() {
+ return mUnmodifiableConferenceableCalls;
+ }
+
+ /**
* Obtains the state of this {@code Call}.
*
* @return A state value, chosen from the {@code STATE_*} constants.
@@ -568,9 +596,8 @@ public final class Call {
}
/** {@hide} */
- final void internalUpdate(ParcelableCall parcelableCall) {
+ final void internalUpdate(ParcelableCall parcelableCall, Map<String, Call> callIdMap) {
// First, we update the internal state as far as possible before firing any updates.
-
Details details = new Details(
parcelableCall.getHandle(),
parcelableCall.getHandlePresentation(),
@@ -619,6 +646,20 @@ public final class Call {
}
}
+ List<String> conferenceableCallIds = parcelableCall.getConferenceableCallIds();
+ List<Call> conferenceableCalls = new ArrayList<Call>(conferenceableCallIds.size());
+ for (String otherId : conferenceableCallIds) {
+ if (callIdMap.containsKey(otherId)) {
+ conferenceableCalls.add(callIdMap.get(otherId));
+ }
+ }
+
+ if (!Objects.equals(mConferenceableCalls, conferenceableCalls)) {
+ mConferenceableCalls.clear();
+ mConferenceableCalls.addAll(conferenceableCalls);
+ fireConferenceableCallsChanged();
+ }
+
// Now we fire updates, ensuring that any client who listens to any of these notifications
// gets the most up-to-date state.
@@ -719,6 +760,13 @@ public final class Call {
}
}
+ private void fireConferenceableCallsChanged() {
+ Listener[] listeners = mListeners.toArray(new Listener[mListeners.size()]);
+ for (int i = 0; i < listeners.length; i++) {
+ listeners[i].onConferenceableCallsChanged(this, mUnmodifiableConferenceableCalls);
+ }
+ }
+
private int stateFromParcelableCallState(CallState parcelableCallState) {
switch (parcelableCallState) {
case NEW:
@@ -742,4 +790,4 @@ public final class Call {
return STATE_NEW;
}
}
-} \ No newline at end of file
+}
diff --git a/telecomm/java/android/telecomm/Connection.java b/telecomm/java/android/telecomm/Connection.java
index 8845821..d347aad 100644
--- a/telecomm/java/android/telecomm/Connection.java
+++ b/telecomm/java/android/telecomm/Connection.java
@@ -21,9 +21,9 @@ import android.net.Uri;
import android.os.Bundle;
import java.util.ArrayList;
-import java.util.HashSet;
import java.util.List;
import java.util.Set;
+import java.util.concurrent.CopyOnWriteArraySet;
/**
* Represents a connection to a remote endpoint that carries voice traffic.
@@ -49,7 +49,8 @@ public abstract class Connection {
public void onAudioModeIsVoipChanged(Connection c, boolean isVoip) {}
public void onStatusHintsChanged(Connection c, StatusHints statusHints) {}
public void onStartActivityFromInCall(Connection c, PendingIntent intent) {}
- public void onFailed(Connection c, int code, String msg) {}
+ public void onConferenceableConnectionsChanged(
+ Connection c, List<Connection> conferenceableConnections) {}
}
public final class State {
@@ -67,8 +68,18 @@ public abstract class Connection {
}
- private final Set<Listener> mListeners = new HashSet<>();
+ private final Listener mConnectionDeathListener = new Listener() {
+ @Override
+ public void onDestroyed(Connection c) {
+ if (mConferenceableConnections.remove(c)) {
+ fireOnConferenceableConnectionsChanged();
+ }
+ }
+ };
+
+ private final Set<Listener> mListeners = new CopyOnWriteArraySet<>();
private final List<Connection> mChildConnections = new ArrayList<>();
+ private final List<Connection> mConferenceableConnections = new ArrayList<>();
private int mState = State.NEW;
private CallAudioState mCallAudioState;
@@ -485,7 +496,7 @@ public abstract class Connection {
}
/**
- * TODO(santoscordon): Needs documentation.
+ * Tears down the Connection object.
*/
public final void destroy() {
// It is possible that onDestroy() will trigger the listener to remove itself which will
@@ -534,6 +545,24 @@ public abstract class Connection {
}
/**
+ * Sets the connections with which this connection can be conferenced.
+ *
+ * @param conferenceableConnections The set of connections this connection can conference with.
+ */
+ public final void setConferenceableConnections(List<Connection> conferenceableConnections) {
+ clearConferenceableList();
+ for (Connection c : conferenceableConnections) {
+ // If statement checks for duplicates in input. It makes it N^2 but we're dealing with a
+ // small amount of items here.
+ if (!mConferenceableConnections.contains(c)) {
+ c.addConnectionListener(mConnectionDeathListener);
+ mConferenceableConnections.add(c);
+ }
+ }
+ fireOnConferenceableConnectionsChanged();
+ }
+
+ /**
* Launches an activity for this connection on top of the in-call UI.
*
* @param intent The intent to use to start the activity.
@@ -580,7 +609,7 @@ public abstract class Connection {
public void onDisconnect() {}
/**
- * Notifies this Connection of a request to disconnect.
+ * Notifies this Connection of a request to separate from its parent conference.
*/
public void onSeparate() {}
@@ -634,6 +663,16 @@ public abstract class Connection {
*/
public void onPhoneAccountClicked() {}
+ /**
+ * Merge this connection and the specified connection into a conference call. Once the
+ * connections are merged, the calls should be added to the an existing or new
+ * {@code Conference} instance. For new {@code Conference} instances, use
+ * {@code ConnectionService#addConference}.
+ *
+ * @param otherConnection The connection with which this connection should be conferenced.
+ */
+ public void onConferenceWith(Connection otherConnection) {}
+
private void addChild(Connection connection) {
Log.d(this, "adding child %s", connection);
mChildConnections.add(connection);
@@ -693,4 +732,17 @@ public abstract class Connection {
public static Connection getCanceledConnection() {
return CANCELED_CONNECTION;
}
+
+ private final void fireOnConferenceableConnectionsChanged() {
+ for (Listener l : mListeners) {
+ l.onConferenceableConnectionsChanged(this, mConferenceableConnections);
+ }
+ }
+
+ private final void clearConferenceableList() {
+ for (Connection c : mConferenceableConnections) {
+ c.removeConnectionListener(mConnectionDeathListener);
+ }
+ mConferenceableConnections.clear();
+ }
}
diff --git a/telecomm/java/android/telecomm/ConnectionService.java b/telecomm/java/android/telecomm/ConnectionService.java
index 4c85f00..53b304a 100644
--- a/telecomm/java/android/telecomm/ConnectionService.java
+++ b/telecomm/java/android/telecomm/ConnectionService.java
@@ -41,9 +41,11 @@ import com.android.internal.telecomm.RemoteServiceCallback;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.Set;
/**
* A {@link android.app.Service} that provides telephone connections to processes running on an
@@ -58,7 +60,6 @@ public abstract class ConnectionService extends Service {
// 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() {};
private static final int MSG_ADD_CALL_SERVICE_ADAPTER = 1;
private static final int MSG_CREATE_CONNECTION = 2;
@@ -77,6 +78,8 @@ public abstract class ConnectionService extends Service {
private static final int MSG_ON_POST_DIAL_CONTINUE = 15;
private static final int MSG_ON_PHONE_ACCOUNT_CLICKED = 16;
+ private static Connection sNullConnection;
+
private final Map<String, Connection> mConnectionById = new HashMap<>();
private final Map<Connection, String> mIdByConnection = new HashMap<>();
private final RemoteConnectionManager mRemoteConnectionManager = new RemoteConnectionManager();
@@ -411,10 +414,11 @@ public abstract class ConnectionService extends Service {
@Override
public void onCallCapabilitiesChanged(Connection c, int callCapabilities) {
String id = mIdByConnection.get(c);
+ Log.d(this, "call capabilities: parcelableconnection: %s",
+ CallCapabilities.toString(callCapabilities));
mAdapter.setCallCapabilities(id, callCapabilities);
}
- /** ${inheritDoc} */
@Override
public void onParentConnectionChanged(Connection c, Connection parent) {
String id = mIdByConnection.get(c);
@@ -445,6 +449,20 @@ public abstract class ConnectionService extends Service {
String id = mIdByConnection.get(c);
mAdapter.startActivityFromInCall(id, intent);
}
+
+ @Override
+ public void onConferenceableConnectionsChanged(
+ Connection connection, List<Connection> conferenceableConnections) {
+ String id = mIdByConnection.get(connection);
+ List<String> conferenceableCallIds = new ArrayList<>(conferenceableConnections.size());
+ for (Connection c : conferenceableConnections) {
+ if (mIdByConnection.containsKey(c)) {
+ conferenceableCallIds.add(mIdByConnection.get(c));
+ }
+ }
+ Collections.sort(conferenceableCallIds);
+ mAdapter.setConferenceableConnections(id, conferenceableCallIds);
+ }
};
/** {@inheritDoc} */
@@ -519,6 +537,14 @@ public abstract class ConnectionService extends Service {
private void connectionCreated(ConnectionRequest request, Connection connection) {
addConnection(request.getCallId(), connection);
+ Uri handle = connection.getHandle();
+ String number = handle == null ? "null" : handle.getSchemeSpecificPart();
+ Log.v(this, "connectionCreated, parcelableconnection: %s, %d, %s",
+ toLogSafePhoneNumber(number),
+ connection.getState(),
+ CallCapabilities.toString(connection.getCallCapabilities()));
+
+
mAdapter.handleCreateConnectionSuccessful(
request,
new ParcelableConnection(
@@ -583,7 +609,7 @@ public abstract class ConnectionService extends Service {
Log.d(this, "conference %s, %s", conferenceCallId, callId);
Connection connection = findConnectionForAction(callId, "conference");
- if (connection == NULL_CONNECTION) {
+ if (connection == getNullConnection()) {
Log.w(this, "Connection missing in conference request %s.", callId);
return;
}
@@ -616,7 +642,7 @@ public abstract class ConnectionService extends Service {
Log.d(this, "splitFromConference(%s)", callId);
Connection connection = findConnectionForAction(callId, "splitFromConference");
- if (connection == NULL_CONNECTION) {
+ if (connection == getNullConnection()) {
Log.w(this, "Connection missing in conference request %s.", callId);
return;
}
@@ -844,7 +870,14 @@ public abstract class ConnectionService extends Service {
return mConnectionById.get(callId);
}
Log.w(this, "%s - Cannot find Connection %s", action, callId);
- return NULL_CONNECTION;
+ return getNullConnection();
+ }
+
+ private final static synchronized Connection getNullConnection() {
+ if (sNullConnection == null) {
+ sNullConnection = new Connection() {};
+ }
+ return sNullConnection;
}
public static abstract class VideoCallProvider {
diff --git a/telecomm/java/android/telecomm/ConnectionServiceAdapter.java b/telecomm/java/android/telecomm/ConnectionServiceAdapter.java
index ea61362..6499ec4 100644
--- a/telecomm/java/android/telecomm/ConnectionServiceAdapter.java
+++ b/telecomm/java/android/telecomm/ConnectionServiceAdapter.java
@@ -350,6 +350,16 @@ final class ConnectionServiceAdapter implements DeathRecipient {
}
}
+ void setConferenceableConnections(String callId, List<String> conferenceableCallIds) {
+ Log.v(this, "setConferenceableConnections: %s, %s", callId, conferenceableCallIds);
+ for (IConnectionServiceAdapter adapter : mAdapters) {
+ try {
+ adapter.setConferenceableConnections(callId, conferenceableCallIds);
+ } catch (RemoteException ignored) {
+ }
+ }
+ }
+
void startActivityFromInCall(String callId, PendingIntent intent) {
for (IConnectionServiceAdapter adapter : mAdapters) {
try {
diff --git a/telecomm/java/android/telecomm/ConnectionServiceAdapterServant.java b/telecomm/java/android/telecomm/ConnectionServiceAdapterServant.java
index 3ef61ac..1685bd7 100644
--- a/telecomm/java/android/telecomm/ConnectionServiceAdapterServant.java
+++ b/telecomm/java/android/telecomm/ConnectionServiceAdapterServant.java
@@ -16,17 +16,19 @@
package android.telecomm;
-import com.android.internal.os.SomeArgs;
-import com.android.internal.telecomm.IConnectionServiceAdapter;
-import com.android.internal.telecomm.IVideoCallProvider;
-import com.android.internal.telecomm.RemoteServiceCallback;
-
import android.app.PendingIntent;
import android.net.Uri;
import android.os.Handler;
import android.os.Message;
import android.os.RemoteException;
+import com.android.internal.os.SomeArgs;
+import com.android.internal.telecomm.IConnectionServiceAdapter;
+import com.android.internal.telecomm.IVideoCallProvider;
+import com.android.internal.telecomm.RemoteServiceCallback;
+
+import java.util.List;
+
/**
* A component that provides an RPC servant implementation of {@link IConnectionServiceAdapter},
* posting incoming messages on the main thread on a client-supplied delegate object.
@@ -58,6 +60,7 @@ final class ConnectionServiceAdapterServant {
private static final int MSG_SET_HANDLE = 20;
private static final int MSG_SET_CALLER_DISPLAY_NAME = 21;
private static final int MSG_START_ACTIVITY_FROM_IN_CALL = 22;
+ private static final int MSG_SET_CONFERENCEABLE_CONNECTIONS = 23;
private final IConnectionServiceAdapter mDelegate;
@@ -209,6 +212,16 @@ final class ConnectionServiceAdapterServant {
}
break;
}
+ case MSG_SET_CONFERENCEABLE_CONNECTIONS: {
+ SomeArgs args = (SomeArgs) msg.obj;
+ try {
+ mDelegate.setConferenceableConnections(
+ (String) args.arg1, (List<String>) args.arg2);
+ } finally {
+ args.recycle();
+ }
+ break;
+ }
}
}
};
@@ -365,6 +378,15 @@ final class ConnectionServiceAdapterServant {
args.arg2 = intent;
mHandler.obtainMessage(MSG_START_ACTIVITY_FROM_IN_CALL, args).sendToTarget();
}
+
+ @Override
+ public final void setConferenceableConnections(
+ String connectionId, List<String> conferenceableConnectionIds) {
+ SomeArgs args = SomeArgs.obtain();
+ args.arg1 = connectionId;
+ args.arg2 = conferenceableConnectionIds;
+ mHandler.obtainMessage(MSG_SET_CONFERENCEABLE_CONNECTIONS, args).sendToTarget();
+ }
};
public ConnectionServiceAdapterServant(IConnectionServiceAdapter delegate) {
diff --git a/telecomm/java/android/telecomm/InCallAdapter.java b/telecomm/java/android/telecomm/InCallAdapter.java
index 964686a..279e47d 100644
--- a/telecomm/java/android/telecomm/InCallAdapter.java
+++ b/telecomm/java/android/telecomm/InCallAdapter.java
@@ -219,9 +219,9 @@ public final class InCallAdapter {
* @param callId The unique ID of the call.
* @hide
*/
- public void conference(String callId) {
+ public void conference(String callId, String otherCallId) {
try {
- mAdapter.conference(callId);
+ mAdapter.conference(callId, otherCallId);
} catch (RemoteException ignored) {
}
}
diff --git a/telecomm/java/android/telecomm/ParcelableCall.java b/telecomm/java/android/telecomm/ParcelableCall.java
index e60761a..360e768 100644
--- a/telecomm/java/android/telecomm/ParcelableCall.java
+++ b/telecomm/java/android/telecomm/ParcelableCall.java
@@ -25,6 +25,7 @@ import android.telephony.DisconnectCause;
import com.android.internal.telecomm.IVideoCallProvider;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
/**
@@ -51,8 +52,8 @@ public final class ParcelableCall implements Parcelable {
private final List<String> mChildCallIds;
private final StatusHints mStatusHints;
private final int mVideoState;
+ private final List<String> mConferenceableCallIds;
- /** @hide */
public ParcelableCall(
String id,
CallState state,
@@ -71,7 +72,8 @@ public final class ParcelableCall implements Parcelable {
String parentCallId,
List<String> childCallIds,
StatusHints statusHints,
- int videoState) {
+ int videoState,
+ List<String> conferenceableCallIds) {
mId = id;
mState = state;
mDisconnectCauseCode = disconnectCauseCode;
@@ -90,6 +92,7 @@ public final class ParcelableCall implements Parcelable {
mChildCallIds = childCallIds;
mStatusHints = statusHints;
mVideoState = videoState;
+ mConferenceableCallIds = Collections.unmodifiableList(conferenceableCallIds);
}
/** The unique ID of the call. */
@@ -183,7 +186,6 @@ public final class ParcelableCall implements Parcelable {
/**
* The conference call to which this call is conferenced. Null if not conferenced.
- * @hide
*/
public String getParentCallId() {
return mParentCallId;
@@ -192,12 +194,15 @@ public final class ParcelableCall implements Parcelable {
/**
* The child call-IDs if this call is a conference call. Returns an empty list if this is not
* a conference call or if the conference call contains no children.
- * @hide
*/
public List<String> getChildCallIds() {
return mChildCallIds;
}
+ public List<String> getConferenceableCallIds() {
+ return mConferenceableCallIds;
+ }
+
/**
* The status label and icon.
*
@@ -242,11 +247,13 @@ public final class ParcelableCall implements Parcelable {
source.readList(childCallIds, classLoader);
StatusHints statusHints = source.readParcelable(classLoader);
int videoState = source.readInt();
+ List<String> conferenceableCallIds = new ArrayList<>();
+ source.readList(conferenceableCallIds, classLoader);
return new ParcelableCall(id, state, disconnectCauseCode, disconnectCauseMsg,
cannedSmsResponses, capabilities, connectTimeMillis, handle, handlePresentation,
callerDisplayName, callerDisplayNamePresentation, gatewayInfo,
accountHandle, videoCallProvider, parentCallId, childCallIds, statusHints,
- videoState);
+ videoState, conferenceableCallIds);
}
@Override
@@ -283,6 +290,7 @@ public final class ParcelableCall implements Parcelable {
destination.writeList(mChildCallIds);
destination.writeParcelable(mStatusHints, 0);
destination.writeInt(mVideoState);
+ destination.writeList(mConferenceableCallIds);
}
@Override
diff --git a/telecomm/java/android/telecomm/ParcelableConnection.java b/telecomm/java/android/telecomm/ParcelableConnection.java
index e0bfab6..2f79004 100644
--- a/telecomm/java/android/telecomm/ParcelableConnection.java
+++ b/telecomm/java/android/telecomm/ParcelableConnection.java
@@ -98,6 +98,18 @@ public final class ParcelableConnection implements Parcelable {
return mVideoState;
}
+ @Override
+ public String toString() {
+ return new StringBuilder()
+ .append("ParcelableConnection [act:")
+ .append(mPhoneAccount)
+ .append(", state:")
+ .append(mState)
+ .append(", capabilities:")
+ .append(CallCapabilities.toString(mCapabilities))
+ .toString();
+ }
+
public static final Parcelable.Creator<ParcelableConnection> CREATOR =
new Parcelable.Creator<ParcelableConnection> () {
@Override
diff --git a/telecomm/java/android/telecomm/Phone.java b/telecomm/java/android/telecomm/Phone.java
index c0454ee..4ad572d 100644
--- a/telecomm/java/android/telecomm/Phone.java
+++ b/telecomm/java/android/telecomm/Phone.java
@@ -100,7 +100,7 @@ public final class Phone {
mCallByTelecommCallId.put(parcelableCall.getId(), call);
mCalls.add(call);
checkCallTree(parcelableCall);
- call.internalUpdate(parcelableCall);
+ call.internalUpdate(parcelableCall, mCallByTelecommCallId);
fireCallAdded(call);
}
@@ -116,7 +116,7 @@ public final class Phone {
Call call = mCallByTelecommCallId.get(parcelableCall.getId());
if (call != null) {
checkCallTree(parcelableCall);
- call.internalUpdate(parcelableCall);
+ call.internalUpdate(parcelableCall, mCallByTelecommCallId);
}
}
diff --git a/telecomm/java/android/telecomm/RemoteConnection.java b/telecomm/java/android/telecomm/RemoteConnection.java
index bb272fa..197e480 100644
--- a/telecomm/java/android/telecomm/RemoteConnection.java
+++ b/telecomm/java/android/telecomm/RemoteConnection.java
@@ -23,6 +23,8 @@ import android.telephony.DisconnectCause;
import com.android.internal.telecomm.IConnectionService;
+import java.util.ArrayList;
+import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@@ -171,11 +173,14 @@ public final class RemoteConnection {
* @param connection The {@code RemoteConnection} invoking this method.
*/
public void onDestroyed(RemoteConnection connection) {}
+ public void onConferenceableConnectionsChanged(
+ RemoteConnection connection, List<RemoteConnection> conferenceableConnections) {}
}
private IConnectionService mConnectionService;
private final String mConnectionId;
private final Set<Listener> mListeners = new HashSet<>();
+ private final Set<RemoteConnection> mConferenceableConnections = new HashSet<>();
private int mState = Connection.State.NEW;
private int mDisconnectCauseCode = DisconnectCause.NOT_VALID;
@@ -658,6 +663,16 @@ public final class RemoteConnection {
}
}
+ /** @hide */
+ void setConferenceableConnections(List<RemoteConnection> conferenceableConnections) {
+ mConferenceableConnections.clear();
+ mConferenceableConnections.addAll(conferenceableConnections);
+ for (Listener l : mListeners) {
+ l.onConferenceableConnectionsChanged(
+ this, new ArrayList<RemoteConnection>(mConferenceableConnections));
+ }
+ }
+
/**
* Create a RemoteConnection which is in the {@link Connection.State#FAILED} state. Attempting
* to use it for anything will almost certainly result in bad things happening. Do not do this.
diff --git a/telecomm/java/android/telecomm/RemoteConnectionService.java b/telecomm/java/android/telecomm/RemoteConnectionService.java
index 14c7691..9325bbb 100644
--- a/telecomm/java/android/telecomm/RemoteConnectionService.java
+++ b/telecomm/java/android/telecomm/RemoteConnectionService.java
@@ -32,6 +32,8 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
+import java.util.Collections;
+import java.util.List;
import java.util.UUID;
/**
@@ -195,6 +197,18 @@ final class RemoteConnectionService {
public IBinder asBinder() {
throw new UnsupportedOperationException();
}
+
+ @Override
+ public final void setConferenceableConnections(
+ String callId, List<String> conferenceableConnectionIds) {
+
+ // TODO: When we support more than 1 remote connection, this should
+ // loop through the incoming list of connection IDs and acquire the list
+ // of remote connections which correspond to the IDs. That list should
+ // be set onto the remote connections.
+ findConnectionForAction(callId, "setConferenceableConnections")
+ .setConferenceableConnections(Collections.<RemoteConnection>emptyList());
+ }
};
private final ConnectionServiceAdapterServant mServant =
diff --git a/telecomm/java/com/android/internal/telecomm/IConnectionServiceAdapter.aidl b/telecomm/java/com/android/internal/telecomm/IConnectionServiceAdapter.aidl
index 60b5e1e..c6f9712 100644
--- a/telecomm/java/com/android/internal/telecomm/IConnectionServiceAdapter.aidl
+++ b/telecomm/java/com/android/internal/telecomm/IConnectionServiceAdapter.aidl
@@ -77,5 +77,7 @@ oneway interface IConnectionServiceAdapter {
void setCallerDisplayName(String callId, String callerDisplayName, int presentation);
+ void setConferenceableConnections(String callId, in List<String> conferenceableCallIds);
+
void startActivityFromInCall(String callId, in PendingIntent intent);
}
diff --git a/telecomm/java/com/android/internal/telecomm/IInCallAdapter.aidl b/telecomm/java/com/android/internal/telecomm/IInCallAdapter.aidl
index fc09a3a..8bc950f 100644
--- a/telecomm/java/com/android/internal/telecomm/IInCallAdapter.aidl
+++ b/telecomm/java/com/android/internal/telecomm/IInCallAdapter.aidl
@@ -51,7 +51,7 @@ oneway interface IInCallAdapter {
void phoneAccountSelected(String callId, in PhoneAccountHandle accountHandle);
- void conference(String callId);
+ void conference(String callId, String otherCallId);
void splitFromConference(String callId);