From c2a978dba31f0fc83a7d472e6a78bed165eca610 Mon Sep 17 00:00:00 2001 From: Sailesh Nepal Date: Sat, 20 Sep 2014 18:23:05 -0700 Subject: [PATCH] Pass disconnect reason for failed remote connections If a remote connection fails to create call setDisconnected instead of setState. This allows us to pass the disconnect reason. Note, this CL is very low risk since it only impacts remote connections. Bug: 17594857 Change-Id: Id296f3f5a4bb9168b358d3bfda94e04623a6b99c --- telecomm/java/android/telecom/RemoteConnectionService.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/telecomm/java/android/telecom/RemoteConnectionService.java b/telecomm/java/android/telecom/RemoteConnectionService.java index 03b38c2aaaad9..d959e50dda5f1 100644 --- a/telecomm/java/android/telecom/RemoteConnectionService.java +++ b/telecomm/java/android/telecom/RemoteConnectionService.java @@ -65,7 +65,11 @@ final class RemoteConnectionService { parcel.getCallerDisplayName(), parcel.getCallerDisplayNamePresentation()); // Set state after handle so that the client can identify the connection. - connection.setState(parcel.getState()); + if (parcel.getState() == Connection.STATE_DISCONNECTED) { + connection.setDisconnected(parcel.getDisconnectCause()); + } else { + connection.setState(parcel.getState()); + } List conferenceable = new ArrayList<>(); for (String confId : parcel.getConferenceableConnectionIds()) { if (mConnectionById.containsKey(confId)) {