Loading src/com/android/server/telecom/CreateConnectionProcessor.java +38 −1 Original line number Diff line number Diff line Loading @@ -89,6 +89,7 @@ final class CreateConnectionProcessor { private DisconnectCause mLastErrorDisconnectCause; private final PhoneAccountRegistrar mPhoneAccountRegistrar; private final Context mContext; private boolean mShouldUseConnectionManager = true; CreateConnectionProcessor( Call call, ConnectionServiceRepository repository, CreateConnectionResponse response, Loading Loading @@ -185,6 +186,10 @@ final class CreateConnectionProcessor { } private boolean shouldSetConnectionManager() { if (!mShouldUseConnectionManager) { return false; } if (mAttemptRecords.size() == 0) { return false; } Loading Loading @@ -307,12 +312,44 @@ final class CreateConnectionProcessor { } } private boolean shouldFallbackToNoConnectionManager(DisconnectCause cause) { PhoneAccountHandle handle = mCall.getConnectionManagerPhoneAccount(); if (handle == null || !handle.equals(mPhoneAccountRegistrar.getSimCallManager())) { return false; } ConnectionServiceWrapper connectionManager = mCall.getConnectionService(); if (connectionManager == null) { return false; } if (cause.getCode() == DisconnectCause.CONNECTION_MANAGER_NOT_SUPPORTED) { Log.d(CreateConnectionProcessor.this, "Connection manager declined to handle the " + "call, falling back to not using a connection manager"); return true; } if (!connectionManager.isServiceValid("createConnection")) { Log.d(CreateConnectionProcessor.this, "Connection manager unbound while trying " + "create a connection, falling back to not using a connection manager"); return true; } return false; } @Override public void handleCreateConnectionFailure(DisconnectCause errorDisconnectCause) { // Failure of some sort; record the reasons for failure and try again if possible Log.d(CreateConnectionProcessor.this, "Connection failed: (%s)", errorDisconnectCause); mLastErrorDisconnectCause = errorDisconnectCause; if (shouldFallbackToNoConnectionManager(errorDisconnectCause)) { mShouldUseConnectionManager = false; // Restart from the beginning. process(); } else { attemptNextPhoneAccount(); } } } } Loading
src/com/android/server/telecom/CreateConnectionProcessor.java +38 −1 Original line number Diff line number Diff line Loading @@ -89,6 +89,7 @@ final class CreateConnectionProcessor { private DisconnectCause mLastErrorDisconnectCause; private final PhoneAccountRegistrar mPhoneAccountRegistrar; private final Context mContext; private boolean mShouldUseConnectionManager = true; CreateConnectionProcessor( Call call, ConnectionServiceRepository repository, CreateConnectionResponse response, Loading Loading @@ -185,6 +186,10 @@ final class CreateConnectionProcessor { } private boolean shouldSetConnectionManager() { if (!mShouldUseConnectionManager) { return false; } if (mAttemptRecords.size() == 0) { return false; } Loading Loading @@ -307,12 +312,44 @@ final class CreateConnectionProcessor { } } private boolean shouldFallbackToNoConnectionManager(DisconnectCause cause) { PhoneAccountHandle handle = mCall.getConnectionManagerPhoneAccount(); if (handle == null || !handle.equals(mPhoneAccountRegistrar.getSimCallManager())) { return false; } ConnectionServiceWrapper connectionManager = mCall.getConnectionService(); if (connectionManager == null) { return false; } if (cause.getCode() == DisconnectCause.CONNECTION_MANAGER_NOT_SUPPORTED) { Log.d(CreateConnectionProcessor.this, "Connection manager declined to handle the " + "call, falling back to not using a connection manager"); return true; } if (!connectionManager.isServiceValid("createConnection")) { Log.d(CreateConnectionProcessor.this, "Connection manager unbound while trying " + "create a connection, falling back to not using a connection manager"); return true; } return false; } @Override public void handleCreateConnectionFailure(DisconnectCause errorDisconnectCause) { // Failure of some sort; record the reasons for failure and try again if possible Log.d(CreateConnectionProcessor.this, "Connection failed: (%s)", errorDisconnectCause); mLastErrorDisconnectCause = errorDisconnectCause; if (shouldFallbackToNoConnectionManager(errorDisconnectCause)) { mShouldUseConnectionManager = false; // Restart from the beginning. process(); } else { attemptNextPhoneAccount(); } } } }