summaryrefslogtreecommitdiffstats
path: root/wifi/java/android/net
diff options
context:
space:
mode:
authorRobert Greenwalt <rgreenwalt@google.com>2013-10-04 13:36:49 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-10-04 13:36:49 -0700
commit3378384123154ae29b3fb8cc87244ae742fae6bf (patch)
treebe9b2ee3c1875f5624a7d7ba86a2ee9e7ec182c6 /wifi/java/android/net
parent3d31219fb9685050e41462e8098cfbc570e10938 (diff)
parent72566b98dba80f21923cb6b299754d510951d611 (diff)
downloadframeworks_base-3378384123154ae29b3fb8cc87244ae742fae6bf.zip
frameworks_base-3378384123154ae29b3fb8cc87244ae742fae6bf.tar.gz
frameworks_base-3378384123154ae29b3fb8cc87244ae742fae6bf.tar.bz2
am 72566b98: am 1c6fdd6c: am cac2fd30: Merge "Revert "Use a build-specific wifi country code"" into klp-dev
* commit '72566b98dba80f21923cb6b299754d510951d611': Revert "Use a build-specific wifi country code"
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 cf09836..349fe24 100644
--- a/wifi/java/android/net/wifi/WifiStateMachine.java
+++ b/wifi/java/android/net/wifi/WifiStateMachine.java
@@ -1466,6 +1466,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);
@@ -1698,8 +1701,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 {
@@ -2424,6 +2427,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);
}