Skip to content

Commit 1733a3d

Browse files
David BrownAndroid (Google) Code Review
authored andcommitted
Merge "SIP addresses containing "911" shouldn't be considered emergency calls" into ics-mr1
2 parents 9be4962 + 277b13e commit 1733a3d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

telephony/java/android/telephony/PhoneNumberUtils.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1575,6 +1575,17 @@ private static boolean isEmergencyNumberInternal(String number, boolean useExact
15751575
// If the number passed in is null, just return false:
15761576
if (number == null) return false;
15771577

1578+
// If the number passed in is a SIP address, return false, since the
1579+
// concept of "emergency numbers" is only meaningful for calls placed
1580+
// over the cell network.
1581+
// (Be sure to do this check *before* calling extractNetworkPortionAlt(),
1582+
// since the whole point of extractNetworkPortionAlt() is to filter out
1583+
// any non-dialable characters (which would turn 'abc911def@example.com'
1584+
// into '911', for example.))
1585+
if (isUriNumber(number)) {
1586+
return false;
1587+
}
1588+
15781589
// Strip the separators from the number before comparing it
15791590
// to the list.
15801591
number = extractNetworkPortionAlt(number);

0 commit comments

Comments
 (0)