Enable account selection for MMI codes that involve "dialing".

Some MMI codes (specifically a small set of GSM codes) involve pressing
"dial" to send the code. The connection service identifies that this is
an MMI code and responds accordingly, including canceling the call. In
the multi-SIM case, we want to bring up a dialog to select a SIM
"connect" through. We can use the current PRE_DIAL_WAIT state and select
account dialog to do this.

Bug: 17573147
Change-Id: Id765e595f3149c088ae5de72a97cc2034338b6ee
diff --git a/src/com/android/server/telecom/CallsManager.java b/src/com/android/server/telecom/CallsManager.java
index 795213c..ce9a8cd 100644
--- a/src/com/android/server/telecom/CallsManager.java
+++ b/src/com/android/server/telecom/CallsManager.java
@@ -566,7 +566,10 @@
             return null;
         }
 
-        if (phoneAccountHandle == null && accounts.size() > 1 && !isEmergencyCall) {
+        boolean needsAccountSelection = phoneAccountHandle == null && accounts.size() > 1 &&
+                !isEmergencyCall;
+
+        if (needsAccountSelection) {
             // 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);
@@ -577,7 +580,7 @@
         call.setExtras(extras);
 
         // Do not add the call if it is a potential MMI code.
-        if (isPotentialMMICode(handle) || isPotentialInCallMMICode) {
+        if ((isPotentialMMICode(handle) || isPotentialInCallMMICode) && !needsAccountSelection) {
             call.addListener(this);
         } else {
             addCall(call);