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

Commit 1c00cd6b authored by Shuo Qian's avatar Shuo Qian Committed by android-build-merger
Browse files

Merge "Fix emergency number exactMatch flag."

am: 69e27963

Change-Id: I38298e8bf7da7ca6ad8305798b19e8383b33e11f
parents c3915ae1 69e27963
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;
                            }
                        }