Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 69e27963 authored by Shuo Qian's avatar Shuo Qian Committed by Gerrit Code Review
Browse files

Merge "Fix emergency number exactMatch flag."

parents 8db85cb0 ebd75350
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -473,7 +473,7 @@ public class EmergencyNumberTracker extends Handler {
                        || mCountryIso.equals("ni")) {
                    exactMatch = true;
                } else {
                    exactMatch = false;
                    exactMatch = false || exactMatch;
                }
                if (exactMatch) {
                    if (num.getNumber().equals(number)) {
@@ -670,9 +670,11 @@ public class EmergencyNumberTracker extends Handler {
            // searches through the comma-separated list for a match,
            // return true if one is found.
            for (String emergencyNum : emergencyNumbers.split(",")) {
                // It is not possible to append additional digits to an emergency number to dial
                // the number in Brazil - it won't connect.
                if (useExactMatch || "br".equalsIgnoreCase(mCountryIso)) {
                // According to com.android.i18n.phonenumbers.ShortNumberInfo, in
                // these countries, if extra digits are added to an emergency number,
                // it no longer connects to the emergency service.
                if (useExactMatch || mCountryIso.equals("br") || mCountryIso.equals("cl")
                        || mCountryIso.equals("ni")) {
                    if (number.equals(emergencyNum)) {
                        return true;
                    } else {
@@ -687,7 +689,7 @@ public class EmergencyNumberTracker extends Handler {
                        return true;
                    } else {
                        for (String prefix : mEmergencyNumberPrefix) {
                            if (number.equals(prefix + emergencyNum)) {
                            if (number.startsWith(prefix + emergencyNum)) {
                                return true;
                            }
                        }