Skip "PRE_DIAL_WAIT" when no accounts are available to chose from.
Go straight into "CONNECTING" state when no account is preset and there
are no available accounts to select from (for example if it is a SIP
call and no SIP accounts are registered). The InCallUi will handle
disconnecting the call and displaying an error message.
Bug: 17486242
Change-Id: Ieaa89c908caab15811d4708f76fe674bd96900b8
diff --git a/src/com/android/server/telecom/CallsManager.java b/src/com/android/server/telecom/CallsManager.java
index 6135279..706ab7b 100644
--- a/src/com/android/server/telecom/CallsManager.java
+++ b/src/com/android/server/telecom/CallsManager.java
@@ -384,7 +384,7 @@
return null;
}
- if (phoneAccountHandle == null && !isEmergencyCall) {
+ if (phoneAccountHandle == null && accounts.size() > 1 && !isEmergencyCall) {
// This is the state where the user is expected to select an account
call.setState(CallState.PRE_DIAL_WAIT);
extras.putParcelableList(android.telecom.Call.AVAILABLE_PHONE_ACCOUNTS, accounts);