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

Commit e452a0e7 authored by sqian's avatar sqian Committed by Shuo Qian
Browse files

Keep old country ISO for country-related emergency number if signal is lost

Sometimes the country is updated as an empty string when the network signal
is lost; though we may not call emergency when there is no signal, we want
to keep the old country iso to provide country-related emergency numbers,
because they think they are still in that country. So we don't need to update
country change in this case.

Bug: 130779927
Test: Sanity
Change-Id: I08f93a5bf20d81d0cf98b87b352b84bb1425ef2b
parent d825b351
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -122,6 +122,14 @@ public class EmergencyNumberTracker extends Handler {
                            TelephonyManager.EXTRA_NETWORK_COUNTRY);
                    logd("ACTION_NETWORK_COUNTRY_CHANGED: PhoneId: " + phoneId + " CountryIso: "
                            + countryIso);
                    // Sometimes the country is updated as an empty string when the network signal
                    // is lost; though we may not call emergency when there is no signal, we want
                    // to keep the old country iso to provide country-related emergency numbers,
                    // because they think they are still in that country. So we do need to update
                    // country change in this case.
                    if (TextUtils.isEmpty(countryIso)) {
                        return;
                    }
                    updateEmergencyNumberDatabaseCountryChange(countryIso);
                }
                return;