Handle IMEI_NOT_ACCEPTED disconnect cause

Some networks (in e.g. the UK) dont accept emergency calls from
a mobile station that is identified by the IMEI (i.e. no IMSI).
Present the user with a reasonable error message for this case.

Bug: 33263903
Test: manual (simulated error code from the network)
Change-Id: I185e03bf76b7f9db20c8150ef4b3f2410ce95f2f
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 34cdeb5..72a7fc7 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -1361,6 +1361,11 @@
         There are too many active calls. Please end or merge existing calls before placing a new one.
     </string>
 
+    <!-- Call failure reason: If the network does not accept the emergency call request, e.g., because IMEI was used as identification and this capability is not supported -->
+    <string name="callFailed_imei_not_accepted">
+        Unable to connect, please insert a valid SIM card.
+    </string>
+
     <!-- The title for the change voicemail PIN activity -->
     <string name="change_pin_title">Change Voicemail PIN</string>
     <!-- The label for the continue button in change voicemail PIN activity -->
diff --git a/src/com/android/services/telephony/DisconnectCauseUtil.java b/src/com/android/services/telephony/DisconnectCauseUtil.java
index 6eb4a4e..534f510 100644
--- a/src/com/android/services/telephony/DisconnectCauseUtil.java
+++ b/src/com/android/services/telephony/DisconnectCauseUtil.java
@@ -129,6 +129,7 @@
             case android.telephony.DisconnectCause.DATA_DISABLED:
             case android.telephony.DisconnectCause.DATA_LIMIT_REACHED:
             case android.telephony.DisconnectCause.DIALED_ON_WRONG_SLOT:
+            case android.telephony.DisconnectCause.IMEI_NOT_ACCEPTED:
                 return DisconnectCause.ERROR;
 
             case android.telephony.DisconnectCause.DIALED_MMI:
@@ -381,6 +382,10 @@
                 resourceId = R.string.callFailed_data_limit_reached_description;
                 break;
 
+            case android.telephony.DisconnectCause.IMEI_NOT_ACCEPTED:
+                resourceId = R.string.callFailed_imei_not_accepted;
+                break;
+
             default:
                 break;
         }