summaryrefslogtreecommitdiffstats
path: root/wifi/java/android/net
diff options
context:
space:
mode:
authorRobert Greenwalt <rgreenwalt@google.com>2013-10-03 21:13:49 +0000
committerRobert Greenwalt <rgreenwalt@google.com>2013-10-03 21:15:54 +0000
commit3ea0c99b67407bb1612875762b037e50f013fd6d (patch)
tree4a91dc5164f18dea15c935bc3e785d02a3c999c1 /wifi/java/android/net
parentc33cd23c17c24df33550a6662cedfe60b323604a (diff)
downloadframeworks_base-3ea0c99b67407bb1612875762b037e50f013fd6d.zip
frameworks_base-3ea0c99b67407bb1612875762b037e50f013fd6d.tar.gz
frameworks_base-3ea0c99b67407bb1612875762b037e50f013fd6d.tar.bz2
Revert "Use a build-specific wifi country code"
This reverts commit c33cd23c17c24df33550a6662cedfe60b323604a. bug:11064682 Change-Id: I35825a7005e75f3abf02f23f31dee1cb7b101c31
Diffstat (limited to 'wifi/java/android/net')
-rw-r--r--wifi/java/android/net/wifi/WifiStateMachine.java14
-rw-r--r--wifi/java/android/net/wifi/p2p/WifiP2pService.java6
2 files changed, 18 insertions, 2 deletions
diff --git a/wifi/java/android/net/wifi/WifiStateMachine.java b/wifi/java/android/net/wifi/WifiStateMachine.java
index 798bc2e..76bd636 100644
--- a/wifi/java/android/net/wifi/WifiStateMachine.java
+++ b/wifi/java/android/net/wifi/WifiStateMachine.java
@@ -1456,6 +1456,9 @@ public class WifiStateMachine extends StateMachine {
public void setCountryCode(String countryCode, boolean persist) {
if (persist) {
mPersistedCountryCode = countryCode;
+ Settings.Global.putString(mContext.getContentResolver(),
+ Settings.Global.WIFI_COUNTRY_CODE,
+ countryCode);
}
sendMessage(CMD_SET_COUNTRY_CODE, countryCode);
mWifiP2pChannel.sendMessage(WifiP2pService.SET_COUNTRY_CODE, countryCode);
@@ -1688,8 +1691,8 @@ public class WifiStateMachine extends StateMachine {
* Set the country code from the system setting value, if any.
*/
private void setCountryCode() {
- String countryCode = mContext.getResources().getString(
- R.string.config_wifi_default_country_code);
+ String countryCode = Settings.Global.getString(mContext.getContentResolver(),
+ Settings.Global.WIFI_COUNTRY_CODE);
if (countryCode != null && !countryCode.isEmpty()) {
setCountryCode(countryCode, false);
} else {
@@ -2414,6 +2417,13 @@ public class WifiStateMachine extends StateMachine {
case CMD_BOOT_COMPLETED:
String countryCode = mPersistedCountryCode;
if (TextUtils.isEmpty(countryCode) == false) {
+ Settings.Global.putString(mContext.getContentResolver(),
+ Settings.Global.WIFI_COUNTRY_CODE,
+ countryCode);
+ // it may be that the state transition that should send this info
+ // to the driver happened between mPersistedCountryCode getting set
+ // and now, so simply persisting it here would mean we have sent
+ // nothing to the driver. Send the cmd so it might be set now.
sendMessageAtFrontOfQueue(CMD_SET_COUNTRY_CODE, countryCode);
}
break;
diff --git a/wifi/java/android/net/wifi/p2p/WifiP2pService.java b/wifi/java/android/net/wifi/p2p/WifiP2pService.java
index 50e8e3d..625ffb8 100644
--- a/wifi/java/android/net/wifi/p2p/WifiP2pService.java
+++ b/wifi/java/android/net/wifi/p2p/WifiP2pService.java
@@ -2545,6 +2545,12 @@ public class WifiP2pService extends IWifiP2pManager.Stub {
mServiceTransactionId = 0;
mServiceDiscReqId = null;
+ String countryCode = Settings.Global.getString(mContext.getContentResolver(),
+ Settings.Global.WIFI_COUNTRY_CODE);
+ if (countryCode != null && !countryCode.isEmpty()) {
+ mP2pStateMachine.sendMessage(SET_COUNTRY_CODE, countryCode);
+ }
+
updatePersistentNetworks(RELOAD);
}