diff options
author | Elliott Hughes <enh@google.com> | 2013-08-02 09:07:54 -0700 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2013-08-02 09:07:54 -0700 |
commit | ee00b353a4070a9ddbdf67fa715dc84e7282f7c2 (patch) | |
tree | 84ab4364e026b711a3fc8209bade1985e4a31d28 /wifi/java | |
parent | c67b2ed50226c4758d0fc1434d39f6add6a0a533 (diff) | |
download | frameworks_base-ee00b353a4070a9ddbdf67fa715dc84e7282f7c2.zip frameworks_base-ee00b353a4070a9ddbdf67fa715dc84e7282f7c2.tar.gz frameworks_base-ee00b353a4070a9ddbdf67fa715dc84e7282f7c2.tar.bz2 |
When wifi wants ASCII lowercasing, it needs to ask for it.
http://elliotth.blogspot.com/2012/01/beware-convenience-methods.html
Bug: https://code.google.com/p/android/issues/detail?id=58359
Change-Id: Ibf25d0bbc76015cf8353ec01ab2b743cbc2bde67
Diffstat (limited to 'wifi/java')
4 files changed, 9 insertions, 4 deletions
diff --git a/wifi/java/android/net/wifi/WifiInfo.java b/wifi/java/android/net/wifi/WifiInfo.java index 502d1ab..5d130c6 100644 --- a/wifi/java/android/net/wifi/WifiInfo.java +++ b/wifi/java/android/net/wifi/WifiInfo.java @@ -26,6 +26,7 @@ import java.net.InetAddress; import java.net.Inet4Address; import java.net.UnknownHostException; import java.util.EnumMap; +import java.util.Locale; /** * Describes the state of any Wifi connection that is active or @@ -275,7 +276,7 @@ public class WifiInfo implements Parcelable { return SupplicantState.FOUR_WAY_HANDSHAKE; else { try { - return SupplicantState.valueOf(stateName.toUpperCase()); + return SupplicantState.valueOf(stateName.toUpperCase(Locale.ROOT)); } catch (IllegalArgumentException e) { return SupplicantState.INVALID; } diff --git a/wifi/java/android/net/wifi/WifiStateMachine.java b/wifi/java/android/net/wifi/WifiStateMachine.java index 520ac20..ebc94e0 100644 --- a/wifi/java/android/net/wifi/WifiStateMachine.java +++ b/wifi/java/android/net/wifi/WifiStateMachine.java @@ -82,6 +82,7 @@ import java.io.PrintWriter; import java.net.InetAddress; import java.util.ArrayList; import java.util.List; +import java.util.Locale; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicBoolean; import java.util.Iterator; @@ -2496,7 +2497,7 @@ public class WifiStateMachine extends StateMachine { case CMD_SET_COUNTRY_CODE: String country = (String) message.obj; if (DBG) log("set country code " + country); - if (!mWifiNative.setCountryCode(country.toUpperCase())) { + if (!mWifiNative.setCountryCode(country.toUpperCase(Locale.ROOT))) { loge("Failed to set country code " + country); } break; diff --git a/wifi/java/android/net/wifi/p2p/nsd/WifiP2pDnsSdServiceInfo.java b/wifi/java/android/net/wifi/p2p/nsd/WifiP2pDnsSdServiceInfo.java index bc1d3c6..9879d4e 100644 --- a/wifi/java/android/net/wifi/p2p/nsd/WifiP2pDnsSdServiceInfo.java +++ b/wifi/java/android/net/wifi/p2p/nsd/WifiP2pDnsSdServiceInfo.java @@ -22,6 +22,7 @@ import android.text.TextUtils; import java.util.ArrayList; import java.util.HashMap; import java.util.List; +import java.util.Locale; import java.util.Map; /** @@ -183,7 +184,7 @@ public class WifiP2pDnsSdServiceInfo extends WifiP2pServiceInfo { * | Type (2) | Version (1) | */ if (dnsType == WifiP2pDnsSdServiceInfo.DNS_TYPE_TXT) { - dnsName = dnsName.toLowerCase(); + dnsName = dnsName.toLowerCase(Locale.ROOT); // TODO: is this right? } sb.append(compressDnsName(dnsName)); sb.append(String.format("%04x", dnsType)); diff --git a/wifi/java/android/net/wifi/p2p/nsd/WifiP2pServiceRequest.java b/wifi/java/android/net/wifi/p2p/nsd/WifiP2pServiceRequest.java index c7f0e5f..eabd8e5 100644 --- a/wifi/java/android/net/wifi/p2p/nsd/WifiP2pServiceRequest.java +++ b/wifi/java/android/net/wifi/p2p/nsd/WifiP2pServiceRequest.java @@ -20,6 +20,8 @@ import android.net.wifi.p2p.WifiP2pManager; import android.os.Parcel; import android.os.Parcelable; +import java.util.Locale; + /** * A class for creating a service discovery request for use with * {@link WifiP2pManager#addServiceRequest} and {@link WifiP2pManager#removeServiceRequest} @@ -167,7 +169,7 @@ public class WifiP2pServiceRequest implements Parcelable { } // check whether query is hex string. - query = query.toLowerCase(); + query = query.toLowerCase(Locale.ROOT); char[] chars = query.toCharArray(); for (char c: chars) { if (!((c >= '0' && c <= '9') || |