summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorNingyuan Wang <nywang@google.com>2017-03-14 14:23:24 -0700
committerNingyuan Wang <nywang@google.com>2017-03-15 23:39:08 +0000
commit586197ab0ed6d1c9d76c7b461a19ab8733ce9b3a (patch)
treee852ac5bc7e466f5388f400d5fddbf6d784a588e /service
parent1df53b3ec09d8bd1713b55167ebe283bd1c1a9e9 (diff)
Stop supporting persistent country code
This actually reverts ag/1108739/, which we don't need anymore. Bug: 29353903 Test: compile, unit tests Change-Id: Ic0e52f0832d0b78a3b6f7e24694e2b0427866d75
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/WifiCountryCode.java10
-rw-r--r--service/java/com/android/server/wifi/WifiInjector.java2
-rw-r--r--service/java/com/android/server/wifi/WifiServiceImpl.java13
3 files changed, 4 insertions, 21 deletions
diff --git a/service/java/com/android/server/wifi/WifiCountryCode.java b/service/java/com/android/server/wifi/WifiCountryCode.java
index 13396562a..58bf90fa0 100644
--- a/service/java/com/android/server/wifi/WifiCountryCode.java
+++ b/service/java/com/android/server/wifi/WifiCountryCode.java
@@ -42,15 +42,12 @@ public class WifiCountryCode {
public WifiCountryCode(
WifiNative wifiNative,
String oemDefaultCountryCode,
- String persistentCountryCode,
boolean revertCountryCodeOnCellularLoss) {
mWifiNative = wifiNative;
mRevertCountryCodeOnCellularLoss = revertCountryCodeOnCellularLoss;
- if (!TextUtils.isEmpty(persistentCountryCode)) {
- mDefaultCountryCode = persistentCountryCode.toUpperCase();
- } else if (!TextUtils.isEmpty(oemDefaultCountryCode)) {
+ if (!TextUtils.isEmpty(oemDefaultCountryCode)) {
mDefaultCountryCode = oemDefaultCountryCode.toUpperCase();
} else {
if (mRevertCountryCodeOnCellularLoss) {
@@ -132,16 +129,13 @@ public class WifiCountryCode {
* otherwise we think it is from other applications.
* @return Returns true if the country code passed in is acceptable.
*/
- public synchronized boolean setCountryCode(String countryCode, boolean persist) {
+ public synchronized boolean setCountryCode(String countryCode) {
if (DBG) Log.d(TAG, "Receive set country code request: " + countryCode);
// Ignore empty country code.
if (TextUtils.isEmpty(countryCode)) {
if (DBG) Log.d(TAG, "Ignore empty country code");
return false;
}
- if (persist) {
- mDefaultCountryCode = countryCode;
- }
mTelephonyCountryCode = countryCode.toUpperCase();
// If wpa_supplicant is ready we set the country code now, otherwise it will be
// set once wpa_supplicant is ready.
diff --git a/service/java/com/android/server/wifi/WifiInjector.java b/service/java/com/android/server/wifi/WifiInjector.java
index 6b6f8c78c..54f157616 100644
--- a/service/java/com/android/server/wifi/WifiInjector.java
+++ b/service/java/com/android/server/wifi/WifiInjector.java
@@ -32,7 +32,6 @@ import android.os.Looper;
import android.os.ServiceManager;
import android.os.SystemProperties;
import android.os.UserManager;
-import android.provider.Settings;
import android.security.KeyStore;
import android.telephony.TelephonyManager;
import android.util.LocalLog;
@@ -163,7 +162,6 @@ public class WifiInjector {
mWifiNative.getInterfaceName());
mCountryCode = new WifiCountryCode(mWifiNative,
SystemProperties.get(BOOT_DEFAULT_WIFI_COUNTRY_CODE),
- mFrameworkFacade.getStringSetting(mContext, Settings.Global.WIFI_COUNTRY_CODE),
mContext.getResources()
.getBoolean(R.bool.config_wifi_revert_country_code_on_cellular_loss));
mWifiApConfigStore = new WifiApConfigStore(mContext, mBackupManagerProxy);
diff --git a/service/java/com/android/server/wifi/WifiServiceImpl.java b/service/java/com/android/server/wifi/WifiServiceImpl.java
index 7ab7182d1..ee97eb498 100644
--- a/service/java/com/android/server/wifi/WifiServiceImpl.java
+++ b/service/java/com/android/server/wifi/WifiServiceImpl.java
@@ -1198,18 +1198,9 @@ public class WifiServiceImpl extends IWifiManager.Stub {
" with persist set to " + persist);
enforceConnectivityInternalPermission();
mLog.trace("setCountryCode uid=%").c(Binder.getCallingUid()).flush();
- // TODO b/35150708 Log list of channels when country code is updated
final long token = Binder.clearCallingIdentity();
- try {
- if (mCountryCode.setCountryCode(countryCode, persist) && persist) {
- // Save this country code to persistent storage
- mFacade.setStringSetting(mContext,
- Settings.Global.WIFI_COUNTRY_CODE,
- countryCode);
- }
- } finally {
- Binder.restoreCallingIdentity(token);
- }
+ mCountryCode.setCountryCode(countryCode);
+ Binder.restoreCallingIdentity(token);
}
/**