Dont use isPotentialEmergency for our emergency logic.

isPotentialEmergency number is meant to prevent 3rd party apps from
circumventing our restriction on dialing emergency numbers (only default
dialer can do that).  3rd parties could potentially circumvent it
by dialing an emergency-prefixed number like 911234 since some carriers
will dial emergency services for those numbers as well.
isPotentialEmergency checks prefixes as well to prevent this.

A bug turned up where we were treating too many calls as emergency and
this is because we were too liberal with our use of
isPotentialEmergency().  We needed to only use in the case above but
we ended up using it all over telecom which caused our 'ask every time'
feature to be disabled 911234 even in markets where that is a valid
non-emergency number.

The fix is to replace our isPotentialEmergency check with isLocalEmergency
for the majority of telecom logic. This puts things at par with the
correct behavior from kitkat.

Bug: 21650423
Change-Id: I075ea9937b54e0b4bc4e158943652c30319e62fd
diff --git a/src/com/android/server/telecom/TelephonyUtil.java b/src/com/android/server/telecom/TelephonyUtil.java
index 5827e73..5f43ee9 100644
--- a/src/com/android/server/telecom/TelephonyUtil.java
+++ b/src/com/android/server/telecom/TelephonyUtil.java
@@ -28,8 +28,6 @@
  * differently from 3rd party services in some situations (emergency calls, audio focus, etc...).
  */
 public final class TelephonyUtil {
-    private static final String TAG = TelephonyUtil.class.getSimpleName();
-
     private static final String TELEPHONY_PACKAGE_NAME = "com.android.phone";
 
     private static final String PSTN_CALL_SERVICE_CLASS_NAME =
@@ -63,7 +61,7 @@
     }
 
     public static boolean shouldProcessAsEmergency(Context context, Uri handle) {
-        return handle != null && PhoneNumberUtils.isPotentialLocalEmergencyNumber(
+        return handle != null && PhoneNumberUtils.isLocalEmergencyNumber(
                 context, handle.getSchemeSpecificPart());
     }
 }