summaryrefslogtreecommitdiffstats
path: root/service/java/com
diff options
context:
space:
mode:
authorNingyuan Wang <nywang@google.com>2017-09-12 17:03:10 -0700
committerNingyuan Wang <nywang@google.com>2017-09-12 18:11:03 -0700
commita32e2000025fb2df125c3d14c2fa55ddecd4b790 (patch)
treee6640ba5ab1729007764910064d2e9202fb8f236 /service/java/com
parentf3654b5e48f9e4f6f599b11ff5cd5ae235908916 (diff)
downloadandroid_frameworks_opt_net_wifi-a32e2000025fb2df125c3d14c2fa55ddecd4b790.tar.gz
android_frameworks_opt_net_wifi-a32e2000025fb2df125c3d14c2fa55ddecd4b790.tar.bz2
android_frameworks_opt_net_wifi-a32e2000025fb2df125c3d14c2fa55ddecd4b790.zip
Fix case for not reverting country code on cellular loss
This CL allows us to keep using last known country code on cellular loss and |mRevertCountryCodeOnCellularLoss| is set to false. This also fixes simCardRemoved() to revert country code unconditionally, and cleans up code for airplaneModeEnabled(). Bug: 65602314 Test: compile, unit tests Change-Id: I7b15d9ae197c5e2aacd7788b505e386f970786ed
Diffstat (limited to 'service/java/com')
-rw-r--r--service/java/com/android/server/wifi/WifiCountryCode.java21
1 files changed, 9 insertions, 12 deletions
diff --git a/service/java/com/android/server/wifi/WifiCountryCode.java b/service/java/com/android/server/wifi/WifiCountryCode.java
index e69fb8e1c..66a035f08 100644
--- a/service/java/com/android/server/wifi/WifiCountryCode.java
+++ b/service/java/com/android/server/wifi/WifiCountryCode.java
@@ -83,11 +83,9 @@ public class WifiCountryCode {
public synchronized void simCardRemoved() {
if (DBG) Log.d(TAG, "SIM Card Removed");
// SIM card is removed, we need to reset the country code to phone default.
- if (mRevertCountryCodeOnCellularLoss) {
- mTelephonyCountryCode = null;
- if (mReady) {
- updateCountryCode();
- }
+ mTelephonyCountryCode = null;
+ if (mReady) {
+ updateCountryCode();
}
}
@@ -98,12 +96,9 @@ public class WifiCountryCode {
*/
public synchronized void airplaneModeEnabled() {
if (DBG) Log.d(TAG, "Airplane Mode Enabled");
- mTelephonyCountryCode = null;
// Airplane mode is enabled, we need to reset the country code to phone default.
- if (mRevertCountryCodeOnCellularLoss) {
- mTelephonyCountryCode = null;
- // Country code will be set upon when wpa_supplicant starts next time.
- }
+ // Country code will be set upon when wpa_supplicant starts next time.
+ mTelephonyCountryCode = null;
}
/**
@@ -133,8 +128,10 @@ public class WifiCountryCode {
if (DBG) Log.d(TAG, "Receive set country code request: " + countryCode);
// Empty country code.
if (TextUtils.isEmpty(countryCode)) {
- if (DBG) Log.d(TAG, "Received empty country code, reset to default country code");
- mTelephonyCountryCode = null;
+ if (mRevertCountryCodeOnCellularLoss) {
+ if (DBG) Log.d(TAG, "Received empty country code, reset to default country code");
+ mTelephonyCountryCode = null;
+ }
} else {
mTelephonyCountryCode = countryCode.toUpperCase();
}