Merge "When wifi wants ASCII lowercasing, it needs to ask for it."
This commit is contained in:
@ -26,6 +26,7 @@ import java.net.InetAddress;
|
|||||||
import java.net.Inet4Address;
|
import java.net.Inet4Address;
|
||||||
import java.net.UnknownHostException;
|
import java.net.UnknownHostException;
|
||||||
import java.util.EnumMap;
|
import java.util.EnumMap;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Describes the state of any Wifi connection that is active or
|
* 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;
|
return SupplicantState.FOUR_WAY_HANDSHAKE;
|
||||||
else {
|
else {
|
||||||
try {
|
try {
|
||||||
return SupplicantState.valueOf(stateName.toUpperCase());
|
return SupplicantState.valueOf(stateName.toUpperCase(Locale.ROOT));
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
return SupplicantState.INVALID;
|
return SupplicantState.INVALID;
|
||||||
}
|
}
|
||||||
|
@ -82,6 +82,7 @@ import java.io.PrintWriter;
|
|||||||
import java.net.InetAddress;
|
import java.net.InetAddress;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
@ -2496,7 +2497,7 @@ public class WifiStateMachine extends StateMachine {
|
|||||||
case CMD_SET_COUNTRY_CODE:
|
case CMD_SET_COUNTRY_CODE:
|
||||||
String country = (String) message.obj;
|
String country = (String) message.obj;
|
||||||
if (DBG) log("set country code " + country);
|
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);
|
loge("Failed to set country code " + country);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -22,6 +22,7 @@ import android.text.TextUtils;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -183,7 +184,7 @@ public class WifiP2pDnsSdServiceInfo extends WifiP2pServiceInfo {
|
|||||||
* | Type (2) | Version (1) |
|
* | Type (2) | Version (1) |
|
||||||
*/
|
*/
|
||||||
if (dnsType == WifiP2pDnsSdServiceInfo.DNS_TYPE_TXT) {
|
if (dnsType == WifiP2pDnsSdServiceInfo.DNS_TYPE_TXT) {
|
||||||
dnsName = dnsName.toLowerCase();
|
dnsName = dnsName.toLowerCase(Locale.ROOT); // TODO: is this right?
|
||||||
}
|
}
|
||||||
sb.append(compressDnsName(dnsName));
|
sb.append(compressDnsName(dnsName));
|
||||||
sb.append(String.format("%04x", dnsType));
|
sb.append(String.format("%04x", dnsType));
|
||||||
|
@ -20,6 +20,8 @@ import android.net.wifi.p2p.WifiP2pManager;
|
|||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
|
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A class for creating a service discovery request for use with
|
* A class for creating a service discovery request for use with
|
||||||
* {@link WifiP2pManager#addServiceRequest} and {@link WifiP2pManager#removeServiceRequest}
|
* {@link WifiP2pManager#addServiceRequest} and {@link WifiP2pManager#removeServiceRequest}
|
||||||
@ -167,7 +169,7 @@ public class WifiP2pServiceRequest implements Parcelable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check whether query is hex string.
|
// check whether query is hex string.
|
||||||
query = query.toLowerCase();
|
query = query.toLowerCase(Locale.ROOT);
|
||||||
char[] chars = query.toCharArray();
|
char[] chars = query.toCharArray();
|
||||||
for (char c: chars) {
|
for (char c: chars) {
|
||||||
if (!((c >= '0' && c <= '9') ||
|
if (!((c >= '0' && c <= '9') ||
|
||||||
|
Reference in New Issue
Block a user