Use Emergency PhoneAccount for MT ECM Call on no SIM

Use the correct Emergency PhoneAccount for a MT call on a phone with no
SIM that is in ECM. Also, reject incoming SIP calls that are received on
a disabled PhoneAccount instead of crashing the Phone process.

Bug: 27820226
Change-Id: Iab81df05ba9c4f94f08576baee47475d59760a13
diff --git a/src/com/android/phone/PhoneUtils.java b/src/com/android/phone/PhoneUtils.java
index 1749df2..aa62575 100644
--- a/src/com/android/phone/PhoneUtils.java
+++ b/src/com/android/phone/PhoneUtils.java
@@ -73,6 +73,7 @@
  * Misc utilities for the Phone app.
  */
 public class PhoneUtils {
+    public static final String EMERGENCY_ACCOUNT_HANDLE_ID = "E";
     private static final String LOG_TAG = "PhoneUtils";
     private static final boolean DBG = (PhoneGlobals.DBG_LEVEL >= 2);
 
@@ -2410,7 +2411,8 @@
             Phone phone, String prefix, boolean isEmergency) {
         // TODO: Should use some sort of special hidden flag to decorate this account as
         // an emergency-only account
-        String id = isEmergency ? "E" : prefix + String.valueOf(phone.getIccSerialNumber());
+        String id = isEmergency ? EMERGENCY_ACCOUNT_HANDLE_ID : prefix +
+                String.valueOf(phone.getIccSerialNumber());
         return makePstnPhoneAccountHandleWithPrefix(id, prefix, isEmergency);
     }