Add logging and disconnect reason for null connections.

When a ConnectionService implementation returns a null connection, log this
and also set a unique disconnect reason to indicate in the telecom
dumpsys what happened.

Test: Manual
Bug: 70385625
Change-Id: Iff9846d434d400c4cf036e9ac46167cfb6f6b58c
This commit is contained in:
Tyler Gunn
2017-12-19 15:23:59 -08:00
parent 29f61c21f4
commit fba1a8e61a

View File

@@ -1376,8 +1376,9 @@ public abstract class ConnectionService extends Service {
: onCreateOutgoingConnection(callManagerAccount, request);
Log.d(this, "createConnection, connection: %s", connection);
if (connection == null) {
Log.i(this, "createConnection, implementation returned null connection.");
connection = Connection.createFailedConnection(
new DisconnectCause(DisconnectCause.ERROR));
new DisconnectCause(DisconnectCause.ERROR, "IMPL_RETURNED_NULL_CONNECTION"));
}
connection.setTelecomCallId(callId);