summaryrefslogtreecommitdiffstats
path: root/telecomm
diff options
context:
space:
mode:
authorSailesh Nepal <sail@google.com>2015-01-31 20:17:35 -0800
committerSailesh Nepal <sail@google.com>2015-01-31 20:17:35 -0800
commit2d3ced758fa42d8a7cf941998355f655ed0bf0b8 (patch)
tree14416d1e823fdc182d8faea76ee0ef7c33ad320b /telecomm
parent16bce33af6573e0875dcfd2220afe3582de8f62b (diff)
downloadframeworks_base-2d3ced758fa42d8a7cf941998355f655ed0bf0b8.zip
frameworks_base-2d3ced758fa42d8a7cf941998355f655ed0bf0b8.tar.gz
frameworks_base-2d3ced758fa42d8a7cf941998355f655ed0bf0b8.tar.bz2
Don't set address for failed remote connections
We created failed connections we no address attached. When the connection is sent to RemoteConnectionService the null address is translated to a setAddress() call. This causes all failed connections to show up as "unknown". Fix is to only call setAddress if creating the connection succeeded. BUG: 18830726 Change-Id: I680e2fa4c69157a9fdbfa348c6af1f2f87aafd48
Diffstat (limited to 'telecomm')
-rw-r--r--telecomm/java/android/telecom/RemoteConnectionService.java15
1 files changed, 10 insertions, 5 deletions
diff --git a/telecomm/java/android/telecom/RemoteConnectionService.java b/telecomm/java/android/telecom/RemoteConnectionService.java
index 43a92cb..a9b725b 100644
--- a/telecomm/java/android/telecom/RemoteConnectionService.java
+++ b/telecomm/java/android/telecom/RemoteConnectionService.java
@@ -60,11 +60,16 @@ final class RemoteConnectionService {
mPendingConnections.remove(connection);
// Unconditionally initialize the connection ...
connection.setConnectionCapabilities(parcel.getConnectionCapabilities());
- connection.setAddress(
- parcel.getHandle(), parcel.getHandlePresentation());
- connection.setCallerDisplayName(
- parcel.getCallerDisplayName(),
- parcel.getCallerDisplayNamePresentation());
+ if (parcel.getHandle() != null
+ || parcel.getState() != Connection.STATE_DISCONNECTED) {
+ connection.setAddress(parcel.getHandle(), parcel.getHandlePresentation());
+ }
+ if (parcel.getCallerDisplayName() != null
+ || parcel.getState() != Connection.STATE_DISCONNECTED) {
+ connection.setCallerDisplayName(
+ parcel.getCallerDisplayName(),
+ parcel.getCallerDisplayNamePresentation());
+ }
// Set state after handle so that the client can identify the connection.
if (parcel.getState() == Connection.STATE_DISCONNECTED) {
connection.setDisconnected(parcel.getDisconnectCause());