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

Commit 91c782df authored by Jack Yu's avatar Jack Yu Committed by android-build-merger
Browse files

Merge "Fixed crash in locale tracker"

am: 6ea605c9

Change-Id: Ifbeaf5d7b6451bff0eb7eb8f3de703552241f849
parents 81956e75 6ea605c9
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -408,8 +408,16 @@ public class LocaleTracker extends Handler {
            // Set the country code for wifi. This sets allowed wifi channels based on the
            // country of the carrier we see. If we can't see any, reset to 0 so we don't
            // broadcast on forbidden channels.
            ((WifiManager) mPhone.getContext().getSystemService(Context.WIFI_SERVICE))
                    .setCountryCode(countryIso);
            WifiManager wifiManager = (WifiManager) mPhone.getContext()
                    .getSystemService(Context.WIFI_SERVICE);
            if (wifiManager != null) {
                wifiManager.setCountryCode(countryIso);
            } else {
                msg = "Wifi manager is not available.";
                log(msg);
                mLocalLog.log(msg);
            }


            Intent intent = new Intent(TelephonyManager.ACTION_NETWORK_COUNTRY_CHANGED);
            intent.putExtra(TelephonyManager.EXTRA_NETWORK_COUNTRY, countryIso);