am 60ae2617: Merge "If frameworks wants ASCII casing, it should explicity ask for it."
* commit '60ae2617b4b304fc3e45a441f87d1765714477ba': If frameworks wants ASCII casing, it should explicity ask for it.
This commit is contained in:
@@ -6979,7 +6979,7 @@ public class Intent implements Parcelable, Cloneable {
|
||||
return null;
|
||||
}
|
||||
|
||||
type = type.trim().toLowerCase(Locale.US);
|
||||
type = type.trim().toLowerCase(Locale.ROOT);
|
||||
|
||||
final int semicolonIndex = type.indexOf(';');
|
||||
if (semicolonIndex != -1) {
|
||||
|
||||
@@ -1376,7 +1376,7 @@ public class DatabaseUtils {
|
||||
if (sql.length() < 3) {
|
||||
return STATEMENT_OTHER;
|
||||
}
|
||||
String prefixSql = sql.substring(0, 3).toUpperCase(Locale.US);
|
||||
String prefixSql = sql.substring(0, 3).toUpperCase(Locale.ROOT);
|
||||
if (prefixSql.equals("SEL")) {
|
||||
return STATEMENT_SELECT;
|
||||
} else if (prefixSql.equals("INS") ||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package android.net;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -84,7 +85,7 @@ public class MailTo {
|
||||
}
|
||||
// insert the headers with the name in lowercase so that
|
||||
// we can easily find common headers
|
||||
m.mHeaders.put(Uri.decode(nameval[0]).toLowerCase(),
|
||||
m.mHeaders.put(Uri.decode(nameval[0]).toLowerCase(Locale.ROOT),
|
||||
nameval.length > 1 ? Uri.decode(nameval[1]) : null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package android.net;
|
||||
|
||||
import android.util.Log;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* Describes the buildtime configuration of a network.
|
||||
@@ -63,7 +64,7 @@ public class NetworkConfig {
|
||||
*/
|
||||
public NetworkConfig(String init) {
|
||||
String fragments[] = init.split(",");
|
||||
name = fragments[0].trim().toLowerCase();
|
||||
name = fragments[0].trim().toLowerCase(Locale.ROOT);
|
||||
type = Integer.parseInt(fragments[1]);
|
||||
radio = Integer.parseInt(fragments[2]);
|
||||
priority = Integer.parseInt(fragments[3]);
|
||||
|
||||
@@ -25,6 +25,7 @@ import android.util.Log;
|
||||
import java.net.InetAddress;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* A container class for the http proxy info
|
||||
@@ -87,7 +88,7 @@ public class ProxyProperties implements Parcelable {
|
||||
if (mExclusionList == null) {
|
||||
mParsedExclusionList = new String[0];
|
||||
} else {
|
||||
String splitExclusionList[] = exclusionList.toLowerCase().split(",");
|
||||
String splitExclusionList[] = exclusionList.toLowerCase(Locale.ROOT).split(",");
|
||||
mParsedExclusionList = new String[splitExclusionList.length * 2];
|
||||
for (int i = 0; i < splitExclusionList.length; i++) {
|
||||
String s = splitExclusionList[i].trim();
|
||||
|
||||
@@ -1717,7 +1717,7 @@ public abstract class Uri implements Parcelable, Comparable<Uri> {
|
||||
if (flag == null) {
|
||||
return defaultValue;
|
||||
}
|
||||
flag = flag.toLowerCase();
|
||||
flag = flag.toLowerCase(Locale.ROOT);
|
||||
return (!"false".equals(flag) && !"0".equals(flag));
|
||||
}
|
||||
|
||||
@@ -1745,7 +1745,7 @@ public abstract class Uri implements Parcelable, Comparable<Uri> {
|
||||
public Uri normalizeScheme() {
|
||||
String scheme = getScheme();
|
||||
if (scheme == null) return this; // give up
|
||||
String lowerScheme = scheme.toLowerCase(Locale.US);
|
||||
String lowerScheme = scheme.toLowerCase(Locale.ROOT);
|
||||
if (scheme.equals(lowerScheme)) return this; // no change
|
||||
|
||||
return buildUpon().scheme(lowerScheme).build();
|
||||
|
||||
@@ -19,6 +19,7 @@ package android.net;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Set;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
@@ -305,7 +306,7 @@ public class UrlQuerySanitizer {
|
||||
int length = value.length();
|
||||
if ((mFlags & SCRIPT_URL_OK) != 0) {
|
||||
if (length >= MIN_SCRIPT_PREFIX_LENGTH) {
|
||||
String asLower = value.toLowerCase();
|
||||
String asLower = value.toLowerCase(Locale.ROOT);
|
||||
if (asLower.startsWith(JAVASCRIPT_PREFIX) ||
|
||||
asLower.startsWith(VBSCRIPT_PREFIX)) {
|
||||
return "";
|
||||
|
||||
@@ -18,6 +18,7 @@ package android.net;
|
||||
|
||||
import static android.util.Patterns.GOOD_IRI_CHAR;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@@ -77,7 +78,7 @@ public class WebAddress {
|
||||
String t;
|
||||
if (m.matches()) {
|
||||
t = m.group(MATCH_GROUP_SCHEME);
|
||||
if (t != null) mScheme = t.toLowerCase();
|
||||
if (t != null) mScheme = t.toLowerCase(Locale.ROOT);
|
||||
t = m.group(MATCH_GROUP_AUTHORITY);
|
||||
if (t != null) mAuthInfo = t;
|
||||
t = m.group(MATCH_GROUP_HOST);
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package android.net.http;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* HttpAuthHeader: a class to store HTTP authentication-header parameters.
|
||||
* For more information, see: RFC 2617: HTTP Authentication.
|
||||
@@ -380,12 +382,12 @@ public class HttpAuthHeader {
|
||||
}
|
||||
|
||||
if (token.equalsIgnoreCase(QOP_TOKEN)) {
|
||||
mQop = value.toLowerCase();
|
||||
mQop = value.toLowerCase(Locale.ROOT);
|
||||
return;
|
||||
}
|
||||
|
||||
if (token.equalsIgnoreCase(ALGORITHM_TOKEN)) {
|
||||
mAlgorithm = value.toLowerCase();
|
||||
mAlgorithm = value.toLowerCase(Locale.ROOT);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@ import java.net.InetSocketAddress;
|
||||
import java.net.Socket;
|
||||
import java.security.KeyManagementException;
|
||||
import java.security.cert.X509Certificate;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* A Connection connecting to a secure http server or tunneling through
|
||||
@@ -209,7 +210,7 @@ public class HttpsConnection extends Connection {
|
||||
// to add 'host' header unless we want proxy to answer us with a
|
||||
// 400 Bad Request
|
||||
for (Header h : req.mHttpRequest.getAllHeaders()) {
|
||||
String headerName = h.getName().toLowerCase();
|
||||
String headerName = h.getName().toLowerCase(Locale.ROOT);
|
||||
if (headerName.startsWith("proxy") || headerName.equals("keep-alive")
|
||||
|| headerName.equals("host")) {
|
||||
proxyReq.addHeader(h);
|
||||
|
||||
@@ -456,8 +456,8 @@ public final class NdefRecord implements Parcelable {
|
||||
if (domain == null) throw new NullPointerException("domain is null");
|
||||
if (type == null) throw new NullPointerException("type is null");
|
||||
|
||||
domain = domain.trim().toLowerCase(Locale.US);
|
||||
type = type.trim().toLowerCase(Locale.US);
|
||||
domain = domain.trim().toLowerCase(Locale.ROOT);
|
||||
type = type.trim().toLowerCase(Locale.ROOT);
|
||||
|
||||
if (domain.length() == 0) throw new IllegalArgumentException("domain is empty");
|
||||
if (type.length() == 0) throw new IllegalArgumentException("type is empty");
|
||||
|
||||
@@ -56,6 +56,7 @@ import com.android.internal.widget.ILockSettings;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* The Settings provider contains global system-level device preferences.
|
||||
@@ -5248,7 +5249,7 @@ public final class Settings {
|
||||
* @hide
|
||||
*/
|
||||
public static final String getBluetoothHeadsetPriorityKey(String address) {
|
||||
return BLUETOOTH_HEADSET_PRIORITY_PREFIX + address.toUpperCase();
|
||||
return BLUETOOTH_HEADSET_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -5256,7 +5257,7 @@ public final class Settings {
|
||||
* @hide
|
||||
*/
|
||||
public static final String getBluetoothA2dpSinkPriorityKey(String address) {
|
||||
return BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX + address.toUpperCase();
|
||||
return BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -5264,7 +5265,7 @@ public final class Settings {
|
||||
* @hide
|
||||
*/
|
||||
public static final String getBluetoothInputDevicePriorityKey(String address) {
|
||||
return BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX + address.toUpperCase();
|
||||
return BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -145,7 +145,7 @@ public final class Recognizer {
|
||||
public static String getConfigDir(Locale locale) {
|
||||
if (locale == null) locale = Locale.US;
|
||||
String dir = "/system/usr/srec/config/" +
|
||||
locale.toString().replace('_', '.').toLowerCase();
|
||||
locale.toString().replace('_', '.').toLowerCase(Locale.ROOT);
|
||||
if ((new File(dir)).isDirectory()) return dir;
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -365,7 +365,7 @@ public class Linkify {
|
||||
String scheme, MatchFilter matchFilter,
|
||||
TransformFilter transformFilter) {
|
||||
boolean hasMatches = false;
|
||||
String prefix = (scheme == null) ? "" : scheme.toLowerCase();
|
||||
String prefix = (scheme == null) ? "" : scheme.toLowerCase(Locale.ROOT);
|
||||
Matcher m = p.matcher(s);
|
||||
|
||||
while (m.find()) {
|
||||
|
||||
@@ -18,6 +18,7 @@ package android.util;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* <p>Various utilities for debugging and logging.</p>
|
||||
@@ -78,7 +79,7 @@ public class DebugUtils {
|
||||
Class<?> parent = klass;
|
||||
do {
|
||||
declaredMethod = parent.getDeclaredMethod("get" +
|
||||
pair[0].substring(0, 1).toUpperCase() +
|
||||
pair[0].substring(0, 1).toUpperCase(Locale.ROOT) +
|
||||
pair[0].substring(1),
|
||||
(Class[]) null);
|
||||
} while ((parent = klass.getSuperclass()) != null &&
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package android.webkit;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Locale;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@@ -348,7 +349,7 @@ public final class URLUtil {
|
||||
}
|
||||
}
|
||||
if (extension == null) {
|
||||
if (mimeType != null && mimeType.toLowerCase().startsWith("text/")) {
|
||||
if (mimeType != null && mimeType.toLowerCase(Locale.ROOT).startsWith("text/")) {
|
||||
if (mimeType.equalsIgnoreCase("text/html")) {
|
||||
extension = ".html";
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user