Jon West | d42a514 | 2019-04-17 21:58:05 -0400 | [diff] [blame] | 1 | From 3a41da783fcb9fa53e1e88c304509fadebc8a999 Mon Sep 17 00:00:00 2001 |
| 2 | From: Pierre-Hugues Husson <phh@phh.me> |
| 3 | Date: Mon, 20 Aug 2018 22:39:39 +0200 |
| 4 | Subject: [PATCH] Allow LocaleTracker to work even if wifi is not up (FDE) |
| 5 | |
| 6 | Change-Id: Ie6a83af047bfcefb2588a9f6e31ac64e76c070a8 |
| 7 | --- |
| 8 | src/java/com/android/internal/telephony/LocaleTracker.java | 4 ++-- |
| 9 | 1 file changed, 2 insertions(+), 2 deletions(-) |
| 10 | |
| 11 | diff --git a/src/java/com/android/internal/telephony/LocaleTracker.java b/src/java/com/android/internal/telephony/LocaleTracker.java |
| 12 | index 9d730d440..17b899cd1 100644 |
| 13 | --- a/src/java/com/android/internal/telephony/LocaleTracker.java |
| 14 | +++ b/src/java/com/android/internal/telephony/LocaleTracker.java |
| 15 | @@ -409,8 +409,8 @@ public class LocaleTracker extends Handler { |
| 16 | // country of the carrier we see. If we can't see any, reset to 0 so we don't |
| 17 | // broadcast on forbidden channels. |
| 18 | if (mPhone.getContext().getSystemService(Context.WIFI_SERVICE) != null) |
| 19 | - ((WifiManager) mPhone.getContext().getSystemService(Context.WIFI_SERVICE)) |
| 20 | - .setCountryCode(countryIso); |
| 21 | + WifiManager wifi = (WifiManager)mPhone.getContext().getSystemService(Context.WIFI_SERVICE); |
| 22 | + if(wifi != null) wifi.setCountryCode(countryIso); |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | -- |
| 27 | 2.17.1 |
| 28 | |