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
1 file changed