Start Dialer directly when calling an emergency number

Bug: 37495725
Test: Manually followed the repro steps on Pixel with O seeing Dial pad
show up after calling an emergency number in Contacts app without the
blank Incall UI, on nexus 5 with L see behavior is the same.

Change-Id: Ie6855b5a58105d551d71c351596fefe76570ae7b
diff --git a/src/com/android/contacts/CallUtil.java b/src/com/android/contacts/CallUtil.java
index ddde01c..7172766 100644
--- a/src/com/android/contacts/CallUtil.java
+++ b/src/com/android/contacts/CallUtil.java
@@ -23,6 +23,7 @@
 import android.telecom.PhoneAccountHandle;
 import android.telecom.TelecomManager;
 import android.telecom.VideoProfile;
+import android.telephony.PhoneNumberUtils;
 import android.text.TextUtils;
 
 import com.android.contacts.compat.CompatUtils;
@@ -80,7 +81,17 @@
      * automatically.
      */
     public static Intent getCallIntent(String number) {
-        return getCallIntent(getCallUri(number));
+        Uri uri = getCallUri(number);
+        return PhoneNumberUtils.isEmergencyNumber(number)
+                ? getCallIntentForEmergencyNumber(uri) : getCallIntent(uri);
+    }
+
+    /**
+     * Return an Intent to directly start Dialer when calling an emergency number. Scheme is always
+     * PhoneAccount.SCHEME_TEL.
+     */
+    private static Intent getCallIntentForEmergencyNumber(Uri uri) {
+        return new Intent(Intent.ACTION_DIAL, uri);
     }
 
     /**