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

Commit 2a3538a0 authored by Shuo Qian's avatar Shuo Qian
Browse files

Fix emergency number exactMatch flag.

Bug: 130334172
Bug: 132925387
Test: CTS
Change-Id: Ic34d015013373c2d5b196b58e996f2f5ae03f697
Merged-In: Ic34d015013373c2d5b196b58e996f2f5ae03f697
parent 37c605ac
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -481,7 +481,7 @@ public class EmergencyNumberTracker extends Handler {
                        || mCountryIso.equals("ni")) {
                    exactMatch = true;
                } else {
                    exactMatch = false;
                    exactMatch = false || exactMatch;
                }
                if (exactMatch) {
                    if (num.getNumber().equals(number)) {
@@ -678,9 +678,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 {
@@ -695,7 +697,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;
                            }
                        }