OSDN Git Service

Set remote connection state after setting handle
authorSailesh Nepal <sail@google.com>
Wed, 10 Sep 2014 04:49:14 +0000 (21:49 -0700)
committerSailesh Nepal <sail@google.com>
Wed, 10 Sep 2014 04:49:14 +0000 (21:49 -0700)
This CL sets the remote connection state after setting the
handle. This makes it easier to identify the connection
for things like ring deduping.

Bug: 17448801
Change-Id: Id08ab0bc6a257384842250ced19cd297a58c0b87

telecomm/java/android/telecomm/RemoteConnectionService.java

index 79193c2..d343be7 100644 (file)
@@ -60,13 +60,14 @@ final class RemoteConnectionService {
             if (connection != NULL_CONNECTION && mPendingConnections.contains(connection)) {
                 mPendingConnections.remove(connection);
                 // Unconditionally initialize the connection ...
-                connection.setState(parcel.getState());
                 connection.setCallCapabilities(parcel.getCapabilities());
                 connection.setHandle(
                         parcel.getHandle(), parcel.getHandlePresentation());
                 connection.setCallerDisplayName(
                         parcel.getCallerDisplayName(),
                         parcel.getCallerDisplayNamePresentation());
+                // Set state after handle so that the client can identify the connection.
+                connection.setState(parcel.getState());
                 List<RemoteConnection> conferenceable = new ArrayList<>();
                 for (String confId : parcel.getConferenceableConnectionIds()) {
                     if (mConnectionById.containsKey(confId)) {